They are given a tremendous amount of generosity. Once they are in the GC process, they can extend their H1B indefinitely, something that wasn't available when I got my GC. The spouses are eligible for an EAD, meaning they can work whatever job they want. They have 60 days to find a new job. They can buy houses, they can job hop, they have a lot of flexibility considering that they aren't citizens.
There isn't a single Indian H1B holder that doesn't know they need to be here 15+ years to get their GC and if they get laid off, they need to find a job quickly. And yet, they still gamble on it. Very often they win and get their GC. Sometimes they lose and they have to go back to India. It sucks, but they signed up for it. The US doesn't owe them any sort of guarantee besides the flexibility and generosity that they already give them.