If we want our money not to be free to create and ruin the whole game, we need to ensure that creating it costs something. The saying that there’s no such thing as a free lunch is true, even if you don’t buy the lunch from somebody else, you’ll need to waste food, time, or even heat to cook yourself some lunch.
To make our money not-free, the idea of proof of work appeared. It literally means that you have to be able to prove to the system that you did some work for it. In the case of our money called Monero, the idea is to make players who want newly created coins to use their computers to solve a very difficult problem, and then prove that they did it.
Since computers are not free, and the electricity they use to compute is not free either, that solves our problem of not having free money.
That system of doing hard math to get new coins in return is called mining. Just like mining to get gold, which also takes time and effort.