I am neither a child psychologists nor a behavioral researcher, but a C++ programmer. Nevertheless I happen to have what I think is not a totally uninformed opinion on the matter, so here's my €0.02:
I think the biological mechanism at work here is intelligence. What children do is what you see among most of the social animals you can watch: dogs, crows, monkeys. They have a conflict (either over some resource or over their standing in the group), fight it out, and once it is solved, they will get along as if nothing ever happened. Only the members of very few, and rather intelligent, species will hold grudges against their peers. The big apes do, elephants do (although not as it is described in the old stories), crows do, dolphins might do. This is because holding grudges require a long-term strategy, long-term goals, and/or a system of morale and ethics.
If someone damaged your standing in the social hierarchy by taking away something from you, then this someone is threatening you climbing up one rung on the social ladder. Improving your place on the social ladder, however, is a long-term project. This is something apes work on for years, and humans work on for decades. You know that this person might forever be in your way if you let it get away with it, so you do need to fight this out. IMO, this is, if you cut it down to the bare bone, what holding grudges is about.
Of course, our societies are very complex even compared to those of the apes (you could switch your job and never run into that person again), and even the great apes have rather complex societies: Frans de Waal, in his book Peacemaking among Primates, describes how males chimpanzees pick their friends according to their political agenda ("If I manage to make Luke my mate, we could dethrone Harold, and while I might not be strong enough to be king myself, if Luke becomes king, he will have to give me a lot of freedom, or I'd side with Luke and dethrone him in turn."), while females stick to their preferences. ("I just don't like Lara. I never liked Lara. I will never like Lara. Lara is a bitch.") So it is not as simple as that. But I believe a lot of this is still in us, and this makes a big difference.
Morale and ethics, too, require intellect. De Waal argues that, to a certain extend, the great apes do have morale principles. He describes a scene where a new chimp was added to the group, and because he didn't know the rules yet (they all have to be indoors before anyone gets their evening meal), he caused everybody having to wait for their dinner. Knowing their chimps, once he was inside, in order to protect him, the humans overseeing the colony separated the one who caused the delay. However, they were very surprised that this didn't spare the poor chap a severe beating by the whole group when they met outside the next morning – because they remembered that the one individual did them wrong. IMO this is a perfect example of a scene that children up to a certain age will mostly have forgotten about in the morning, so they never act on what happened last night, let alone longer ago.
IIRC, human children only begin to overtake chimps intellectually when they are three or four. And, as I said before, our societies are much more complex than those of the other apes. So children have a lot to learn until they are able to have their own web of morale believes that resembles the one adult members of their society have. Until then, they just do not have enough knowledge to understand that someone did them wrong by their society's standards, or even to act upon that knowledge.
Of course, this is just one angle to look at the problem from, but it's the one that came to my mind immediately when I read your question. I am, however, very interested in what others will have to say about the issue.
P.S.: For a very interesting different angle on apes vs. other social animals I suggest Mark Rowlands' The Philosopher and the Wolf. (You do not have to be a dog lover to find this interesting.)