God gave free will to Adam and Eve when He created them; He created them to fellowship with Him. They were placed in the Garden of Eden where everything was pristine and divine. Adam was intellectual to the max and even named all the animals of the Kingdom, plus many other things during this period. They were given instructions by God that they could eat of every tree in the garden except for the tree of knowledge of good and evil.
This posed No problem at the time, and God walked in the garden with them in the cool of the day to fellowship. Meantime there is another agenda working behind the scenes, Satan having been exiled out of heaven, thrown down to earth was trying to figure a way to get back at God and re gain dominion of earth. So as the Bible describes his activity in Genesis he approaches Eve, bear in mind there is no evil existing anywhere that God warned. He spoke to her about the tree she wasn't to eat, Satan questions her saying surely God didn't mean that you would surely die if you eat it? This injected in her mind that God is holding back something from her, causing rejection. Plus she develops inferiority at the same time thinking she is less than what she was.
Now is a time to pause, she and Adam had everything from God and held in high standing with dominion over land and sea and all animals. She takes the fruit of the tree and eats it, bingo that did it, she sinned and gave it to Adam and he sinned and guilt, shame and a fear came over them and saw themselves naked.
God comes to see them and can't find them. They exclaim they are naked and He asks who told you that? You ate of the tree didn't you? They sinned and lost dominion and Satan picked up dominion of earth and man. The story begins now for God to make a way to redeem man from Satan and make mankind His own pure people once again.
So from then till JESUS came to redeem man, the Old Testament was written and unfolded to be the shadow of Jesus to be the atonement for all mankind, prophesied in the Old Testament and the New fulfilled it. We now have dominion, through JESUS and the Devil has been defeated through the blood shed by JESUS and we are joint heirs with JESUS and have the power over him. Genesis 2, 3.