(Much of the following contains my own opinions.)
It really depends on the mathematics beeing created, and this is much more of a creative process than I think most people (at least non-mathematicians) realize. It is therefore hard (and somewhat disrespectful) to reduce to a simply cut explaination.
However, often it comes down to a combination of solving a specific problem, simplifying/generalizing things and formalizing them. If you have a specific problem that you want to solve, say in physics, it often helps to reformulate and/or generalize things to get a better understanding of what you are actually doing.
Take the "simple" example of measuring areas and volumes. I really think that this video does a better job than me, in explaining the reformulation of the problem of calculating the area of a circle. It is not hard to understand that these were crucial problems, that needed an exact solution, and by dealing with these sort of problems, calculus was pretty much independently invented/discovered by Gottfried Leibniz and Isaac Newton. Similar problems and related solutions have even been found from the ancient greeks, where for example the, so called, Method of Exhaustion, is a method for finding the area of a shape in a very similar way as one would do using limits and calculus later.
The previous paragraph also sheds some light on another realization, that these developments often take alot of time. Usually, a whole area of mathematics, such as calculus, can take hundereds of years to actually develop. Especially if you count the time people have spent on developing methods to solve the type of problems that led up to the actual development of the field in question. For calculus this was perhaps measuring areas and volumes, and for algebra it was perhaps trying to generalize arithmetic of numbers, for some, perhaps in order to solve equations. Group theory is also a more modern (c. 1800 or so) example of a field, within algebra it self, that more or less emerged from trying to generalize things when solving equations. Many would probably agree that even such an abstract area as logic itself came out of trying to generalize and/or formalize reason and language.
One should also note that even though an area, such as algebra say, may have come out of trying to solve a physical problem, development of the area is also very much due to pure curiosity, and creativity. Even though solving equations may perhaps have started with a physical problem, people who got obsessed with solving equations that others did not managed to solve, were probably among the ones pushing the field forwards. For a thorough read about the development of these fields I suggest either John Stillwell's Mathematics and its History, or (for a somewhat easier read i.m.o.) Victor J. Katz's A History of Mathematics: An Introduction. I honestly think that there are few better ways to get a solid answer to your question, than reading about the history of the development.
Of course fields of mathematics pop up quicker than over a period of hundereds of years. Chaos theory, is perhaps a field closer to physics than many, but by many still considered a field in its own right. Even this perhaps has its root in earlier problems, for example in the studies of the three-body problem by Poincare , but as a field most agree it really first developed during the sixtiees and seventiees, by Edward Lorentz, among others. It, more or less, emerged from the fact that deterministic, sometimes seemingly simple dynamical systems, could have unpredictable and very complicated behaviour. Chaos theory was pretty much what came out of trying to understand how and why this happens.
To conclude, I think solving a specific problem (regardless of what area you are dealing with) precisely, often takes generalizing things and this often results in doing mathematics in one way or the other. The idea of formalizing and generalizing things serves many purposes i.m.o., but perhaps foremost it often makes it more clear to your self, and it makes the problem more accessible to others (at least mathematicians), not familiar with your specific problem.
I hope this gives you an ok grasp of what it might mean to develop mathematics, in as few words as possible. Often new areas does not pop up out of nowhere, but are rather more changes/developments of old ones. A better understanding takes reading alot about other's creations, for example via reading about the history of mathematics. Perhaps someone else can add more concrete examples from, perhaps, more modern developments, where a whole area has more or less popped up from nothing.
: History of Mathematics, Volume: 11, AMS, (1997), pp.272.