Whether by nature, science or God, I believe children are designed that way.
It is a survival instinct:
As pediatrician Dr. Jack Newman says, although it may not be the norm to nurse so long in the industrialized world, the human immune response is not mature until about age five.
This is from a Scientific American article from the 1990's called "How Breastfeeding Protects Newborns" you can read athttp://users.erols.com/cindyrn/29.htm
And in Our Babies Ourselves, Meredith Small says that in traditional cultures, the fussiest children may be the ones most likely to survive childhood in places with high childhood mortality
(they demand the most attention and therefore thrive.)
Those babies who nurse the most and the longest get more immunities (which last as long as any child nurses. ) For most of human history and still in many cultures today, nursing in terms of years is the norm. In Mothering the editor once said the worldwide average weaning age is 4 years.
The action of sucking at the breast (or other things like pacifers) has been found to physically relax a child and slow down their heart rate. And natural substances in mother's milk can relax and calm a cchild down, and make them sleepy, as well as lessening physical pain. I never saw a cookie that could kill pain and fight illness!
And this is just the chemical/biological part of it...not even getting into the love and the warmth and the emotional importance of the physical bond with mom.
In our culture young children are sometimes encouraged to use objects other than mom for physical comfort: pacifiers, blankies, teddy bears and other "lovies" are sometimes recommended as more "age appropriate" for toddlers than nursing....and the question is, does this make for a more materialistic society, if we teach them from an early age that things offer more emotional comfort than people?
I am not saying moms who don't nurse their toddlers don't cuddle them, but sometimes our mainstream culture gets in the way of a mother's loving instincts, with parenting books telling us NOT to comfort our children at bedtime because it's a bad habit. Just yesterday on the Early Show they were recommending Ferber's Cry-it-out book....
And human milk is very nutritious even past the first year. I keep quoting references here for http://www.kellymom.com
that talk about how even in the second year human milk is loaded with calcium, brain-building fats linked to higher IQ's in toddlers who nurse, protein, and vitamins such as folic acid and vitamins A, B12, and C.