Oh! Oh! One thing i‘ve wanted to know for ages (maybe you’ve answered it already) is why they hand out these ridiculously long jail sentences like multiple lifetimes which are physically impossible, only for them to be then amended and made reasonable. Why declare them like that in the first place?
So there's one thing I think you may have a misconception about and then there's a bunch of other stuff here to answer.
In terms of misconceptions: I don't think most of those cases are reversed. This might be selection bias: you only know of the high-profile cases that are reversed? Or maybe you're in a jurisdiction where they're reversed? They are not commonly reversed here.
Why do prosecutors bring all these charges?
Easy, no problem: bargaining power. Or just power, period. I see it the most often here with child sex abuse material cases. Each image carries mandatory minimum jail time. Do you know how many images there usually are on a cell phone of someone who browses that shit? And prosecutors don't restrict themselves to the image itself: they'll charge thumbnails, images in caches, and even images that have been deleted but are in memory that hasn't been overwritten. (All of these had to go to the Supreme Court of the state I'm in before prosecutors would stop.)
Same with online solicitation of a child cases, though those are much stupider because they almost never involve an actual child: it's always police officers pretending they're 13. Prosecutors will count every time the defendant asked for a pic, for them to take a particular action, for a video call, and total that up into a number x 2 mandatory minimum years per.
Can you imagine the relief of the terrified defendant facing 150 CSA images who gets it dropped to 10 or 20? Who now has a chance of getting out in their lifetime?
On the other hand, if that defendant doesn't cave to pressure and plead guilty, they're stuck fighting all 150.
Why does the sentence get so high?
First, because judges want to send a message, and/or because mandatory minimums just add the fuck up. I know there are some states where they default to "concurrent" sentences (i.e., everything is run at the same time, so if you have a 4y and an 8y and a 1y sentence, you serve 8y) but ours defaults to "consecutive" (so they are one after the other; in previous example, would serve 13 years).
Second, not necessarily because the judge wants the person to spend that time in prison but because they want that time hanging over that person's head if and when they get early release on parole or probation (you better behave because otherwise there's 40 or 20 or 85 years of prison time that'll come crashing down on you).
Why don't people serve that much time?
Because the justice system is obsessed with probation and parole and is full of overcrowded prisons. At its most basic level: where does a society want someone, locked in a prison consuming resources, or out of prison working a job and still fully under the threat of incarceration? You have control of them either way.
Probation (serving time with the rest of your sentence being suspended) and parole (early release from prison) are both ways to relieve the pressure of unreasonable sentences. And beyond that, both have become a fundamental way the system works. People can be sentenced to egregious amounts of time, kept under "community supervision" (nicer word for probation or parole) and violated (given a parole or probation violation) whenever they do anything wrong. Thus, that class of people has lesser constitutional rights. They're held by the throat by state or federal authorities. They can be searched. They can be arrested. They can be required to go to meetings and drug tests and programs. (Most of which they have to pay for.) It's an endless source of cash flow for the justice system.
I talk about it more in my entry on probation/parole, available in my sticky post.
So basically, your question "why ridiculous prison sentence?" has these answers: power, showing off power, creating bargaining power, demonstrating power, taking away the defendant's power, and also: feeds into society's obsession with revenge and punishment.