I wonder if you have ever noticed the awkwardness presented in Genesis 1-3 about the number of trees in the garden. Let me work through them, reference by reference:
In Genesis 1 everything is straight-forward (in a literary way). God creates vegetation, including trees, on day three (1:11).
There are two separate accounts of creation and in Genesis 2 we have a more human story. There is a garden and in the centre of it are two trees. One is the tree of life and one the tree of the knowledge of good and evil (2:9).
God tells the man he must not eat from the tree of the knowledge of good and evil (2:17). The woman has not yet been created.
At the beginning of Genesis 3 a serpent pitches up and asks Eve (now in existence) what the rules are. She refers to the one tree in the middle of the garden and explains that it cannot even be touched or she will die (3:3). She doesn't name the tree.
After a bit of intrigue in which the serpent offers a convincing argument (to Eve) she eats and shares the fruit with her husband. Note, it is not an apple.
In 3:11 God asks the man (he addresses Adam) if he has eaten from the tree he was told not to eat from. He blames the woman, she blames the serpent.
Before chucking them out of the garden for good God says (to himself?) that he must do this in case the couple eat from the tree of life also and live forever (3:22).
Many ancient creation legends have a tree of life. As far as I know only the Hebrew/Christian one has a second tree. And even the author/editor of the story seems a little unclear about how it all fits together. Life, death and knowledge. Inter-connected but complex. Nice little allegory.