It is important to understand that Genesis was written some thousands of years after the time of Adam and Eve, and the events were recorded somewhat symbolically.
The tree of life and the tree of the knowledge of good and evil (Gen. 2:9) were not literal trees, but symbols of the two persons in the Garden.
The tree of life was the symbol of Adam in perfection. Adam was to become perfect with Eve in marriage, blessed by God. Then they would have produced children of life. God is the Alpha, and the perfect Adam, the tree of life, is the Omega.
Through give and take between the Alpha and the Omega, a perfect union was to be realized. This is the fulfillment of the purpose of creation. The tree of the knowledge of good and evil was the symbol of Eve.
Through God's blessing, Adam could have fulfilled goodness together with Eve.
However, by uniting with her prematurely, he fulfilled evil. Besides, Adam obtained knowledge through his sensual experience.
This was carnal knowledge, which should have come to him only in maturity. By realizing his transgression, he acquired knowledge of evil.
Thus, Eve was symbolized as the tree of knowledge, and eating the fruit represented experiencing Eve's love.