Modular forms are complex analytic functions with striking symmetries, which play fundamental role in number theory. In the last few decades there have been a series of astonishing predictions from theoretical physics that various basic mathematical numbers when put in a generating series, end up being modular forms, when there is no known mathematical reason for such hidden structure. In this talk, we will first provide a gentle introduction to modular forms, suitable for a broad mathematical audience. We will then focus on spaces** **parametrizing complex plane algebraic curves with line bundles, and prove that generating series of their Betti numbers are modular forms. This verifies physical predictions, using various tools of modern enumerative algebraic geometry. Part of this is joint work with Honglu Fan, Shuai Guo, and Longting Wu.