It wont have to at all. In the end elites can live in secure castles/gated communities surrounded by hi tech wonders while cattle gets rounded up in ghettos. All you need is soldiers and robo factories.
There's nothing that guarantees we will reach a stable solution. I am afraid that Elysium-like scenario will be the default if things continue as they are going now.
Actually literally everything in the universe guarantees that we will reach a stable solution. That's how things work. That stable solution may end up killing billions of people but eventually you get a status quo. Systems gravitate towards low energy states.
Also an Elysium like scenario? That movie was a joke and made no sense. If you're gonna believe in science fiction as the model for the future at least go for something that isn't terrible.
Actually this is how some of the countries run things _right now_. Brazil, Argentine for example, Mexico is close.
Rich living in gated communities or secured compounds. Moving in armored cars or with dedicated security force. Isolated from the poor and miserable majority.
Favelas/villas in the movies are not works of fiction.
This hinges on the assumption that the upper classes have a dependency on the lower classes, e.g. for labor. Once technology and automation invalidate this assumption, Elysium flies off to another star system and the rich live happily ever after while the poor are stuck where they were.
(Note: I'm not advocating this horrible failure of human compassion, I just make a sad observation.)
Well, I think part of the issue is: if the rich leave the world and don't take all the resources with them, doesn't that just mean everyone else can do whatever the hell we want in whatever's left behind?
Wealth is not a bulk of copper. It's the ability to command a productive force. Resources are only one necessary component and definitely not a sufficient one. Humans have had all the resources of this planet for hundreds of thousands of years and lived most of this time in deep penury.
Also, the ability to do whatever one wants with the resources left is not the same as the ability to do the productive thing.
EDIT:
So once Elysium flies away the remaining population will likely have to make do without the productive forces that made Elysium rich in the first place. I guess over time people will find out how to rebuild such productive forces and in the process the society will stratify again. Ultimately Elysium II flies away and the cycle repeats.
(Note: or maybe we can have an inclusive economy where everyone has a stake and contribution)