"And He drove out the man" (Genesis 3:24). This teaches that the Holy One, blessed be He, gave him a divorce like a wife. "And He placed at the east of the garden of Eden the cherubim" (Genesis 3:24). This teaches that the cherubim preceded all the work of creation. "And the flame of the ever-turning sword" (Genesis 3:24), this is Gehinnom. "To guard the way" (Genesis 3:24), this is proper worldly conduct. "The tree of life" (Genesis 3:24). This teaches that proper worldly conduct preceded the tree of life. And "the tree of life" means only Torah, as it is said, "It is a tree of life to those who hold fast to it" (Proverbs 3:18).
Derech Eretz Guards the Tree of Life
Tanna DeBei Eliyahu Rabbah 1:1
ויגרש את האדם (בראשית ג׳:כ״ד) מלמד שנתן לו הקדוש ברוך הוא גירושין כאשה וישכן מקדם לגן עדן את הכרובים (בראשית ג׳:כ״ד) מלמד שהכרובים קדמו לכל מעשה בראשית. ואת להט החרב המתהפכת (בראשית ג׳:כ״ד) זו גיהנם. לשמור את דרך (בראשית ג׳:כ״ב) זו דרך ארץ עץ החיים (בראשית ג׳:כ״ב) מלמד שדרך ארץ קדמה לעץ החיים. ואין עץ החיים אלא תורה שנאמר עץ חיים היא למחזיקים בה (משלי ג׳:י״ח):