The reason women breastfeed for 2+ years is because until WWII, babies always HAVE been breastfed until around age 2, and modern day science has backed up the 60,000 years of history with durn good reason. Even high-society types who were proscribed from breastfeeding (mostly to get them fertile as quickly as possible) and had their breasts bound up as soon as their baby was born... their BABIES were nursed by a "wet nurse" until the age of 2-3, when they were given over to the charge of a governess.
Formula came about because of the war. New mums had to go to work in factories where they couldn't take their infants with them, and SOMETHING needed to be given to their babies to keep they quiet during the day. Then, when they got home from work, they nursed throughout the night. The reason formula is *called* formula, is that there were hundreds of "recipes"/"formulas" published and shared among Rosie the Rivetteers, in Women's magazines, and in Propaganda.
The advent of formula though, was a HUGE breakthrough, because it saved the lives of babies who would otherwise have died. Wet nurses are expensive, and they essentially have to live with you. If a poor woman lost her milk while her baby was unable to digest solids, the baby usually died unless there was another nursing mum to help out. Same token, if a mom died in childbirth, or a baby was unable to latch, the babies would also frequently die.
The 2nd piece of fortunate news is that after the war ended, formulas got "better". Instead of being an oil&milk&cream&sugar&salt combo, science started experimenting with adding vitamins, and testing which ratios worked best for the majority.
The unfortunate bit, is that a stopgap measure, became the norm. Mostly because formula left the kitchen and went into big business. Advertising had no laws on it, any company could claim anything (and did) on billboards and televisions across america. Out of 60,000 years... from the 1950's to the 1980's formula became the norm. It's unfortunate, because while good for women's lib, formula wasn't good for babies... it was good for their parents.
Not that it was BAD for babies... but formula is the McDonalds of infant nutrition. A person can survive eating nothing but McDonalds, even thrive if they're very very careful... but it's not ideal. Not by a long shot.
Science however, kept marching along. (and truth in advertising laws were passed... you'll notice formula commercials now always say "breastmilk is best, but when you can't blah blah blah" or "the *closest* to breastmilk you can give your baby") Formulas kept (and keep) getting better, as we studied more, invented new machines that ALLOWED us to study more, and continued to advance our scientific knowledge. Something was confirmed along the way though... the more we understood about ourselves through science (brain development, muscle development, immune systems, etc.), the more science determined that breastmilk IS best. And furthermore, that the 2 years of nursing that moms had been doing for tens of thousands of years is THE best.
It's the best for so many reasons I'm not even going to list them all out (you've gotten some of the reasons already). The simplest way though, is a parallel. Formula is McDonalds, Breastmilk is a personal chef from Cordon Bleu with advanced degrees in medicine, nutrition, & immunology.
Formula for the masses is a fad that will pass, although it saves so many lives of children who wouldn't be able to live otherwise, it will only go away once we've either "cloned" breastmilk and genetically alter cows to produce human milk & antibodies... or we can synth it (the same way we have synthetic opiates).
I knew ALL of this (Mom's a microbiologist, and you can't swing a cat at thanksgiving without hitting a score of doctors, nurses, psychologists, & researchers)... but could only nurse kiddo 9 months. (Lost my milk due to a MASSIVE infection). I'd planned on self weaning, with the ideal being self weaning between 2 & 3. So we did formula as primary for the next several months, and kept formula as a supplement until DS was 2.
Just as a bit of P.S./ response to the whole "sleeping through the night thing". Some kids are just good sleepers. My son slept 13 hours (waking up once) through the night when he was just a few weeks old. As in not even a month. Kept that up for months, with only the expected sleep changes during growth spurts & teething. During that time he was exclusively breastfed. My best friend's son was on formula (she was going through chemo, no nursing for them!!!), and did the same good sleeper thing. Babies are all different. How they sleep is 90% luck.