The science showing that flight to the moon was possible was worked out in the 17th century, but it took until the mid-20th century for engineering and technology to advance enough to make it happen.
Imagine throwing a ball off of a high mountain. The Earth’s gravity will pull the ball down to the ground. If the ball could be thrown at 24,000 feet per second (7,300 meters per second), it would fall continuously around the curve of the Earth. This is a circular orbit.
If the ball is thrown faster, it continues to gain altitude and will be in an elliptical orbit. A ball launched really fast — about 36,745 feet/s (11,200 m/s) — is said to have achieved escape velocity. The ball is no longer in orbit around Earth, but it will still be orbiting the sun.
Once in orbit, the rockets can be turned off. Objects in space remain traveling at whatever speed they were going when they stopped accelerating.