In Relativity: the special and general theory, Einstein motivates General Relativity by the need to extend relativity not only to inertial frames, but also to accelerated frames. The laws of physics should have the same form in all frames of reference, be they inertial or even accelerated.
But, later in his exposition, his attention seems somehow to shift from a theory of accelerated frames to a theory of gravitation.
The bridge seems to be the Equivalence Principle (" happiest thought of my life" as says Einstein).
I've tried to reconstruct Einstein's train of thought in the way below. In this reconstruction, the Equivalence Principle appears as a way to turn a theory of gravity into a theory of accelerated frames.
My question: is it really the case that the function of the Equivalence Principle is to turn a theory of gravity into a theory of accelerated frames?
My attempt at reconstructing Einstein's project:
The goal is mainly to study frames of reference that are submitted to a gravitational field
but such frames can be seen equivalently as accelerated frames : studying in a purely theoretical way the behaviour of objects in an accelerated frame will therefore yield ( at no experimental cost) a correct theory of gravitation
for example, a purely mental experiment shows that light is bent in an accelerated frame ( such as an elevator accelerated upwards), which implies ( by the Equivalence Principle) that gravity bents light
the road to a theory of gravity is therefore to take an inertial frame S and to consider another frame S' that is accelerated relative to S : studying the effects of acceleration on S' will be the same thing as studying the effects of gravitation on this frame.