I'm sure this question has been asked before since it very obvious and I've heard it before. Nonetheless I've never heard a good answer and an internet search brought up nothing.
The question is, how was the Torah (aka the Five Books of Moses) given if the story of the Torah being given is contained in the these books?
In other words, the Torah tells the story - close to halfway through it - of itself being given. This means that as the Jews of the time were studying the Torah, they were learning about themselves in the present and reading about their future (including mistakes and sins they should have then avoided).
How does this all make sense?