Why does the Torah need to tell us about the formation of Adam (2:7), and subsequently, what Hashem did with him afterwards; when it already informed us about his creation earlier (1:27)?
Rashi (citing the Beraisa of Rebbi Eliezer, the son of Rebbi Yossi ha'Gelili): This is the way of the Torah, to relate something in general terms and to elaborate elsewhere. For example, the Torah later repeats that Hashem formed the animals and the birds (2:19) to teach us that He brought the former to Adam for him to name them, and that He created the birds out of mud (a mixture of water and earth - and not out of water alone).
What are the connotations of "Gan be'Eden mi'Kedem"? When did Hashem plant it, and what purpose did it serve?
Rashi: Hashem 'planted' the Garden in Eden at this point, after the forming of Adam; He planted it on the east side of Eden and its function will be described later in 2:15.
Ramban (citing Targum Onkelos and Midrash Rabah) and Targum Yonasan: The word "mi'Kedem" means (not in the east but) 'before [the world was created]'. Consequently, when the Torah writes that "Hashem Elokim planted a garden (for the Tzadikim - Targum Yonasan)", it does not mean that He planted regular fruit-trees that he brought from other locations. It means that, prior to the Creation, He created a place called Eden, in which He planted a Divine garden, with orderly rows of fruit that He Himself arranged. Those trees, which would never die, would continue to produce fruit forever. 1
In his commentary on the Ramban, R. Chavel (citing the Maharsha) explains that the problem with Rashi's explanation is the fact that the Torah writes "Gan be'Eden mi'Kedem", and not 'Gan be'Eden be'Kedem' (or 'Gan be'Kedem le'Eden).
What is a deeper meaning of "mi'Kedem"?
Rosh: The Avos are called Kedem. The world was created for their sake.
Ramban: It means, 'before the world was created.' Refer to 2:8:2:2 .
QUESTIONS ON RASHI
Rashi writes: "'Mi'Kedem' - in the east of Eden". What is Rashi explaining?
Gur Aryeh: Rashi is disagreeing with Targum Onkelos (who translates as "mi'le'Kadmin" - "already from before;" Refer to 2:8:2:2 ). According to Rashi, we cannot explain that the Garden of Eden had already been planted, because the Torah in 2:5 informs us that no trees sprouted prior to man's creation. Rather, these two verses (2: 7-8) are sequential - first Hashem created man; then He planted the garden.
Rashi is informing us that the garden and Eden are not one and the same, but are two separate entities, 1 and that Hashem placed Adam in the garden which was east of Eden.
See Torah Temimah, citing Berachos 34b, which extrapolates this from "ve'Nahar Yotzei me'Eden l'Hashkos Es ha'Gan" in 2:10.
Rashi writes: "But the verse has already told us, 'And Hashem created man' (1:27)!'" (Refer to 2:8:1 .) Shouldn't Rashi have asked this question on the preceding verse?
Gur Aryeh: According to Targum on our Pasuk (refer to 2:8:2:2 ), Rashi need not ask any question, because our verses are referring to the past (i.e., Hashem had already created man, and the garden; and now He placed man inside.) Only now that Rashi differs with Onkelos must he deal with why the Torah relates man's creation twice.