The Bible does not give us a description of the Tree of Knowledge of Good and Evil. However, we do believe it was a literal tree with literal fruit which looked appealing. Genesis 3:6 (NIV), "the fruit of the tree was good for food and pleasing to the eye, and also desirable for gaining wisdom…" Eating the fruit, itself, did not suddenly spike Adam's and Eve's IQs. It was the act of directly disobeying God that gave the couple an experiential understanding of sin and evil.
Prior to their disobedience, they knew only good and obedience. The couple had perfect health. They had direct, loving, harmonious fellowship with God. Their life in the garden was wonderful. But sin changed everything. They were condemned to the dying process and death; they lost fellowship with God; they lost dominion over the earth; they needed to toil to supply their necessities of life. Thus, they and all of their children have a knowledge of evil.
God foreknew that Adam and Eve would experiment with disobedience, because they would not appreciate the consequences. And God had already planned our redemption through sending His only begotten Son to die for us. "You were redeemed…with the precious blood of Christ, a lamb without blemish or defect. He was chosen before the creation of the world," 1 Peter 1:18-20 (NIV).
But is there a purpose to mankind's experience with sin and evil? Yes! In the resurrection, when Christ establishes His righteous kingdom on earth, people will know all about the horrible consequences of sin. In the kingdom, people will then learn righteousness (Jeremiah 31:33). At the end of Christ's 1,000 reign, people will receive a final test of obedience. It will be our experiences with evil and sin versus good and obedience which will enable us to fully appreciate the different paths. Most will wisely and joyfully choose God's ways. A small percentage will prefer sin, and they will die the second death.