General relativity takes the form of field equations, describing the curvature of space-time and the distribution of matter throughout space-time. The effects of matter and space-time on each other are what we perceive as gravity.
Einstein immediately realized that his theory of special relativity worked only when an object moved in a straight line at a constant speed. What about when one of the spaceships accelerated or traveled in a curve?
Einstein came to realize the principle of equivalence, and it states that an accelerated system is completely physically equivalent to a system inside a gravitational field.
As Einstein later related the discovery, he was sitting in a chair thinking about the problem when he realized that if someone fell from the roof of a house, he wouldn’t feel his own weight. This suddenly gave him an understanding of the equivalence principle.
As with most of Einstein’s major insights, he introduced the idea as a thought experiment. If a group of scientists were in an accelerating spaceship and performed a series of experiments, they would get exactly the same results as if sitting still on a planet whose gravity provided that same acceleration, as shown in this figure.
For example, if a beam of light entered an accelerating spaceship, then the beam would appear to curve slightly, as in the left picture of the following figure. The beam is trying to go straight, but the ship is accelerating, so the path, as viewed inside the ship, would be a curve.