16 And the Lord God commanded the man, saying, “You may surely eat of every tree of the garden, 17 but of the tree of the knowledge of good and evil you shall not eat, for in the day that you eat of it you shall surely die” (Gen 2:16-17).
This raises various issues, which I've discussed before. For instance, "in the day" is a Hebrew idiom for "when". So it doesn't mean you'd die on the same day you eat it.
Take a statement like, "When you have kids of your own, you'll understand!" That doesn't mean the instant they have a child, they'll understand. Rather, it refers to insight that results from the process of childrearing. It can take years for that to sink in.
But here's another issue I haven't discussed: If Adam and Eve had no experience of death, how could they grasp the threat, much less appreciate the gravity of the threat?
Admittedly, there's a distinction between knowledge by description and knowledge by acquaintance. Even so, what would death connote to them, what would be the force of that threat, if that was just an abstract idea?
Was there death in the Garden? I don't think human death antedated the Fall. And I don't believe in pre-Adamites. But what about animal death? Could there be animal death in the Garden? If so, what kind?
Of course, young-earth creationists deny that possibility. There are roughly three components to YEC:
i) Mature creation
ii) Global flood
iii) No antelapsarian mortality
These are logically separable propositions. You can affirm all three, deny all three, affirm one or two. Let's assume for the sake of argument that animal death preexisted the fall. And if you don't want to assume it, that's fine. That just means this post is not for you.
In principle, the Garden of Eden could contain small predators. Adam and Eve could observe predators killing prey animals. Even if they were wild predators, they wouldn't attack creatures the size of Adam and Eve.
I have in mind small predators like the fox, bobcat, Ocelot, Caracal, weasel, and otter. I'm not suggesting these exact species existed at that time and place. Just using them to illustrate the general idea (small predators).
Likewise, there could be predatory birds that would swoop down to snatch snakes, rodents, or whatever. Likewise, nonvenomous snakes could kill and eat rodents.
In theory, you could even have major predators so long as they were tame. As such, they wouldn't be dangerous to Adam and Eve.
A lot depends on the size of Garden, and other details. We tend to think of Eden as a tropical paradise, but it may have been located in a hot, dry region. What made Eden lush was the river.
There's also the question of whether Adam and Eve raised livestock for meat. Although some readers take Gen 9 to mean man only acquired a carnivorous diet after the Fall, the terminology arguably has reference to hunting wild animals–in distinction to livestock. In any case, that's not essential to my argument.
Theoretically, even if there was no death in the Garden, it might be possible to observe predation outside the Garden the elevation of the Garden in relation to the surrounding countryside, natural barriers, and so forth.
For that matter, God could give Adam and Eve dreams of death. Examples of human or animal death in dreams.
The last two examples are more speculative, but they show the range of possible explanations.