undercover....This is my take: The prohibition did not necessarily claim that Adam would literally die the same day he ate the fruit. The author of the story skillfully used an expression ( b-ywm "on the day" + infinitive construct to more generally mean "when" or "after") that was ambiguous in Hebrew, as it could also literally mean "on the day of". It could be taken literally, or it could be taken as a more general expression. For a very good parallel involving the latter, see the story of Shimai in 1 Kings 2. The solemn warning is almost exactly parallel (in Hebrew) to the prohibition in Genesis 2:17. But did Shimai die that very day, or know then that he would die? No, not at all -- he died quite some time later, and came to this realization shortly before his death. But he was as good as dead -- his death became inevitable once he did what he was commanded not to.
The author of Genesis 2-3 intended the prohibition to be ambiguous ... the plot depended on it, as it gave the serpent his opening to question the veracity of the prohibition. But why did Yahweh give a prohibition to Adam and Eve that could be taken too literally? Because Adam and Eve were stupid and God wanted to keep them that way. Yahweh in J is very keen on limiting human progress; see the story of the Tower of Babel in ch. 11, in which Yahweh is dismayed that with one language "nothing they plan to do will be impossible for them" (v. 6). Yahweh's purpose in ch. 2-3 was to keep Adam in his personal abode (with Eve as Adam's helper) as his gardener; the field outside however had no plants, as there was no one tilling the field for Yahweh to provide rain for. The serpent was a denizen of the field and his objective was to get Adam evicted from the garden, presumably so that the land outside the garden would finally have a tiller. Adam and Eve were stupid because they were at the beginning of their lives with no life experience -- they were naked, naive, lacking a knowledge of evil -- they were children. If you study the story in detail, this comes across at every level. The serpent however was smarter than them -- it had a kind of street smarts. Yahweh forbade the tree of knowledge of good and evil because it would irrevocably alter the subordinate status of his gardeners -- they would become "like the gods" with an understanding of morality and divine law. As an etiological myth, the story tries to explain why humans have a capacity for understading divine law unlike the animals but like the animals, man is unable to be immortal like the gods. Man has a place between the divine and the dumb beasts of the field, and the story seeks to explain why. Because Adam and Eve were stupid, God couldn't explain on moral grounds why they shouldn't eat from this tree -- they had no capacity for understanding this. Like children, they could only be told that it would hurt them. Yahweh phrased the prohibition in very grave and serious terms, just as you would with a child telling him/her NOT to do something that would hurt or kill him/her. But it was ambiguous because Yahweh knew that if they took it literally, the prohibition would be more dire and grave to them, and thus they would be more likely to obey the prohibition. It's not an overt lie, but it is misleading because Yahweh would have known that Adam and Eve were so naive that, like children, they would take the prohibition overly literal. The serpent knew the subtleties of the language better, and he knew that Adam and Eve were not going to literally die that day -- but that Yahweh was just using an expression. He first queried Eve to find out how she interpreted the prohibition. He learned that indeed she had her own take on the prohibition, as she rephrased it almost entirely. Eve omitted the ambiguous "day" expression and took from it that she would simply die if she ate the fruit. In reply, the serpent brought back the "day" expression and told her that she would not die (i.e. not ever) but that "on the day" she eats of it she will have her eyes opened with new wisdom and knowledge. The serpent here knew what would happen, that immediately Eve would know good and evil (as it proceeded to happen just as he said), so he similarly was counting on Eve taking the expression literally. So Eve took the fruit and ate it and gave it to her husband, and immediately their naivete was taken away and they understood the concept of shame. They went from being children one moment to adults the next. Because they were now altered, Adam and Eve were no longer suitable helpers in caretaking the garden (just as the animals were not suitable helpers for Adam before the creation of Eve). With the knowledge they now had, they would know how to become immortal and fully "like the gods" (3:22), so Yahweh prevented that from occurring by evicting them from the garden. This is precisely what the serpent wanted -- now the man would till the soil and presumably Yahweh would provide plants and rain for the field. But Yahweh cursed the serpent for tricking Adam and Eve -- such that its offspring would always be at odds with the offspring of Adam and Eve, particularly those who like Adam tilled the fields and suffer snakebite. Yahweh also cursed the soil and brought woes to man for the same reason he confused their languages and dispersed them in ch. 11 -- these curses and woes would keep man from fully realizing his potential. And without having access to the tree of life, death was assured.
This reading brings the story close to its Mesopotamian and Canaanite roots. In Akkadian origin myths, man was created (from the blood of a vanquished god mixed with clay, cf. Akkadian adamu "red blood") to bear the burdens of the gods so that they may rest. In J, Adam was created in the field from dust but then taken and placed in the garden to work as Yahweh's gardener. The notion of the creator god living in a paradisical garden at the source of the rivers on his holy mountain (cf. Ezekiel 28, on Eden being on the "mountain of God") is a well-attested motif from West Semitic mythology. There are also parallels with the story of Enkidu in the Epic of Gilgamesh who is created by the goddess Aruru from clay on the steppe, and who lived as a "child of pleasure" with the animals until he is made into a man by being given a woman and sleeping with her, shedding him of his innocence and he adopts a pastoralist way of life subsequently. The motif of the snake, the tree of life, and the name "Eve" relate to the West Semitic goddess Asherah, who bore the same name (Chawat = "Eve"), who was associated closely with snakes, who was depicted as a creator goddess who shaped people out of clay, and who was represented as a sacred tree with healing powers -- the tree of life. There also was a cultural probihition on eating the fruit of sacred trees. Finally, there were a number of Mesopotamian legends about a food or plant of life. In the Epic of Gilgamesh, a snake steals from Gilgamesh the plant of life. In the myth of Adapa and the South Wind, the first apkallu of the first human king was named Adapa and he angered the gods by breaking the wings of the south wind. His father, the god Ea, sternly warned him against eating the food of life and the drink of life, and then Anu freely offered Adapa the food and drink of life but Adapa refused, thereby preventing himself from attaining immortality. There is probably a long ancestry to the story in J in oral tradition and folklore, and it would never be known what earlier forms there were (although Ezekiel might give a clue, as well as some features of the story itself), but it seems to overlap in part with the range of origin myths that were current in the Near East.