Hashem Elohim allowed the human being to eat the product which was produced by every tree in Gan Eden, except from the tree of knowledge (understanding) of what’s good and bad. So with this knowledge human knew of which trees one could eat and of which tree one couldn’t eat; they should have known that it would be a transgression of the command (i.e. a sin) if they indeed ate from it.
But without the knowledge of what’s good and what’s bad, produced by this one tree, how could Adam and Chavah have known it was ‘bad’ to eat from it’s fruit, and ‘good’ not to eat from it? How could they have been able to make a discernment between good and bad, make a judgement?
One more thing, Hashem seems to have made everything He created ‘good’ and even ‘very good’. If the human being had only experienced good – and witnessed, experienced or practiced nothing with which to contrast good – up until the point they sinned and their eyes were opened, how would the human being have ever been able to inherently know it would be bad to eat from the fruit of this one tree?
How could the human being have known what would be proper and fitting? How could they have known it was the right thing to listen and obey G-d’s voice, and wrong to follow their own voice (i.e. the snake)?