The moon is an enormous mass of rock subject to the same law of gravity as anything else. Contrary to what fairy tales tell us, there is nothing holding it up in the sky.
To understand how the moon maintains it’s distance in relation to the earth, you have to remember two things: 1) the earth is round; and 2) the moon is moving horizontally at a high speed. It’s the horizontal motion over a round earth that keeps the moon from getting any closer.
You can see this more easily by imagining what would happen if the earth were flat. The moon would still travel in a horizontal line above the ground; but because it’s also falling, it would come closer and closer to the flat earth until it collided.
Now imagine what would happen if the flat earth had a slight bend in it. When the moon passes over the bent part of the earth, it will pick up altitude because the ground has dropped away underneath it. Now the moon has farther to fall before hitting the ground; in effect, it can also travel farther horizontally.
Once you realize how the curved earth “drops away” under the moon as it travels, you can see that with a completely round earth, it is possible for the ground to “drop away” perpetually. If an object is moving fast enough horizontally, the curve of the earth balances the distance it falls vertically, and the object never gets any closer. This is what it means to be in orbit.