Einstein knew that his special theory was incomplete because it applied only to objects moving at a uniform speed. Hence "special" theory. Between 1905 and 1915, he pursuited a generalization of the theory that lso included the movement of accelerating objects. He incorporated the concept of "inertia", the way it takes more effort to accelerate heavy objects (a car) than light ones (a shopping cart). Einstein believed that the correct approach to inertia was possible if he made his theory consistent with what he called Mach's principle. This idea by the Austrian physicist Ernst Mach essentially means that inertia arises from the movement of objects relative to the rest of the universe.
Einstein realized that the special theory was inconsistent with gravity. The best gravitational theory at the time was Newton's universal gravitational law, which had held up since 1687. The law stated that gravity moves through space at an infinite speed. If the Sun suddenly disappeared, Earth and all the planets would no longer immediately experience the gravity that keeps them in orbit and shoot into space. This clearly contradicted with the special theory of relativity in which nothing, not even gravity, can move faster than the speed of light. In reality, the light from the Sun takes 8.3 minutes to reach Earth, so a change in the Sun's gravity will not be noticeable any faster. Einstein realized he had to rewrite Newton's laws of gravity.
At the beginning of the development of the general theory of relativity,
it became clear to Einstelin that both concepts were inextricably linked:
gravity and acceleration are equivalent. A person undergoing acceleration in a
sealed box that pushes him to the bottom cannot determine whether that
acceleration is caused by the box hanging in a gravitational field
(just like the acceleration pushes you in your seat) or is caused
by the box accelerating itself (such as the acceleration pushes you back
when an airplane gains speed).
Einstein called this the "equivalence principle".