But what was the point? Who made that tree with the fruit?
The tree was put in the Garden by God because he gave man the choice, Remember the Bible also states the tree of life was in the garden which man was free to eat, including other unamed trees which were in the garden, we can only speculated what they resulted in but all of that was free for man to eat but God told them not to eat the tree of knowledge of good and Evil.
Why did God put that tree there then if he didn't want man to eat from it, why even give them the opportunity? The answer is quite complex. By this time Satan and the Angels who rebelled with him had already rebelled. Satan and the Angels were created ALREADY with the knowledge of good and Evil hence why they could sin, hence why some choose to rebel and as a result of the angels sin Hell was created for them, as a punishment for Sin. Hell was not created for man, it was created for the angels who sinned, now that man can sin however we are also condemned to hell as God must pass that same judgement to sin as he passed concerning the angels who sinned. God created Man, to replace the angels who rebelled in his Kingdom initially without the knowledge of good and evil but God had to give us the opportunity to attain the knowledge in order to be fair first of all because the angels were given that knowledge from the get go and it was why they sinned, without it they wouldn't have, so to be fair to his other creation he had to also give us the opportunity to gain that knowledge but he warned Adam and Eve what that knowledge would lead to.
Secondly he also did it because of Satan. When Satan rebelled he said he could be like the most high, the devil challenged God's authority. He didn't just decide to sin like the watchers he questioned why God was leading, he wanted the throne. Now God could have destroyed Satan right there but the problem is, if your an Angel watching this, Satan claims he can be better than God and God just destroys him, How does that make God look, it doesn't put to bed Satan's claim. Its the reason why Satan is still here and Satan was given time and authority for a period, So all the other Angels could see the result of Satan's autonomy so that Gods authority being the correct way would never be questioned again. In the same way if God created Angels and some sinned, and he then just created beings who couldn't sin he would be admitting defeat in being able to prove his perfect authority to any being with free will. Hence once again man had to be given the choice.