Now you are confusing maths with Physics!
Physics is about describing the fundamental behaviour of reality, and so it is rather natural to think of the work as a process of discovering how to best describe it.
What maths is, is harder to say. Certainly it starts by just picking a set of rules, thus inventing a new thing with some properties.
But, much like how a developer might ”invent” a program that solves some problem, but only ”discover” the bugs they wrote, so the mathematician too must spend a lot of time working with their newly created object to ”discover” what it really does.