This is pretty much correct. If you divorce, you lose your right to be in the UK under your spousal visa because you are no longer the spouse of a settled person. Once the HO is notified (notification is obligatory), you would be given a time Fram, which I believe is 60 days, to leave the UK.
Yes, a letter is sent that will give 60 days from that letter to leave the UK, or to put in a valid application in that time for another visa. The lettter is sent to the address the visa holder gave UKVI and changing addresses and not informing UKVI of that, does not prevent that person from becoming an illegal overstayer.
The letters can take a while to send, so it's longer than 60 days. Or if there isn't much time left on their visa, UKVI may just decide to let it run as they won't have a sponser to extend their visa.
It's the same for other visas too. i.e. Students can lose their university/college sponsor: those on work visas can lose their employer sponsor. These too are given time to find another visa route or to leave the UK by the date given.
If you have young British children you could apply for the parent route, but that is not a given. Or a Tier 2G visa if you have the skills the UK needs and can find a work sponsor, but the emplpyer would have to carry out a RLMT and you would have to apply for that visa from your own country. Or become a student again, but that is expensive and work is limited, if work is allowed and doesn't lead to settlement in the UK. Or if you have 200k and a good business plan, you could try for the Tier 1 (E). Or find another spouse with citizenship or ILR, who can sponsor you.
It's worse for those using an EEA citizen sponsor to be in an EEA country as they don't even get the 60 days to leave that the UK gives those on UK "visas" (UK immigration rules). These lose their "automatic" "right to reside" in the UK. Their EU "Residence Card" for the UK, just becomes invalid. And those non-EEA citizens who are not married to their EEA sponsor partner, get even less rights under EU law.
The sponsorship part of the US immigration process is slightly different, but if you marry and have the 2-year temporary green card and divorce during that period, you are no longer eligible to adjust status to the 10-year green card under the family route. The sponsor is obligated to financially support until the end of the 2-year term only. Once on the 10 year green card couples can divorce without residency being revoked and also become entitled to some government benefits.
The UK spouse/partner visa was extended to 5 years for ILR because of the high number of those who left their partner sponsor as soon as they got ILR.
Even those who can get one of the very few elderly parent dependant visas (application costs about 2.5k and only a handful of these are allowed now) need to have their sponsor sign to say they will pay for them. That now includes paying all their NHS bills too, until they are granted ILR and that will be at least five years later. If they can even get that visa now.
Getting a visa to the UK, or entering the UK under the EEA regulations, doesn't mean you can stay in the UK forever. You need to have at least ILR for that.