The obligatory movement of the Prayer came in the Quran such as reciting the Quran, bowing, prostrating.
Then the Angel Gabriel gave further details, like how to make ablutions, what time is prayer valid etc.
This was then passed onto the companions by the Prophet (peace and blessings be upon him) himself.
Then passed onto the next generation and then onto the generation that recorded all these details and these works reach us now, in this time.