Capitalism has no answer to it, it probably doesn't even consider it to be a problem in the first place.
Like capital is essentially just the ability to make other people work for you. So at first that was strength, then fear of a wrathful god and then building up surplus and abusing the fact that others need to consume and can't build surplus, so that they have to sell/rent their body, soul, moral integrity, their ideas, hopes and dreams in order to survive.
And capitalism is the rule of capital. Yeah that was never an ideology or benevolent system it originated as a mockery of the situation of early industrialism where people lost their jobs, impoverished, had to take long up hour jobs for shitty payment and under unbearable conditions in large factories, where they had to compete with their own children for work and where people lived short shitty lives producing the shit that made the bosses richer and richer. And where on top of that your voting power was tied to your taxes so where the rich would even have more of a say than the people who made them rich.
Hence again "capital-ism". Not monarchy, not democracy, but rule of/by capital. In other words "capitalism" is the increase in power over other people. Like that's what money making investments are supposed to accomplish, previously could could hire 1000 people to do what you want, now you can hire even more than that.
So if people rely on the products of the capitalists production, but the capitalists production doesn't rely on the workers, you've basically a system of enslavement. So either the capitalist keeps you as a pet, who is fed and cared for without producing anything, but is never considered an equal and must obey the tyranny of their master and adopt a doublethink where they have to reconcile their slavery with the "friendship" the master sees that as.
Or you're going to be a stray animal attempting to live in the "wild" (could just be deserted suburbs or reservations for humans, but outside of the "civilized" society that can produce these things.
Or likely you won't be able to live in the wild or be a pet, but you might have to pretend as such, being some jester, hooker, servant, showing your gratitude that they keep you alive even though they don't have to.
Or you know they just don't. They don't keep you alive and you die. Either out of starvation or because you're marked a "criminal" and dealt with by the equally automized police. Seriously henchmen is probably among the first jobs to be automated by capitalism, as violence is one of the most essential, most basic forms of power over people.
Now the most ideal form would be if everyone had their own micro-economy that kept them independent of everyone else and would only exchange surplus with each other. Though that would hardly be capitalism as there's no real (at least no economic) leverage to assert power over other people to do what you want. So capitalism would try to find a new form of capital. Like idk advertisement which makes you feel too fat, too slim, too pale, too dark, boring and depressed unless you sell your ass to someone who claims to tickle an urge that you didn't know you have and probably don't have.
Now practically it often doesn't actually get to the point of capitalism. Either because of strikes, rebellions and revolutions, like seriously the working conditions of the early industrialization didn't really improve on their own, it often required political pressure, the U.S. even fought a civil war to end slavery and slavery as punishment in combination with a massive prison system is apparently still a thing.
So the question should not be what would capitalism do, but what should we do to not end up in capitalism. Like just because self-acclaimed anti-capitalist systems fucked up and thus "capitalism" was often misused as a label for "our team" doesn't mean that it's a good ideology.
Also to not be completely doom and gloom, power for powers sake is also often enough not the motivation of people (including capitalists). So maybe Elon Musk is actually really into space travel and abuses his workers and doesn't let them unionize not out malevolence and out of a lust for power but in order to finance his endeavors and enable him to make other people push boundaries. Maybe, actually probably, people actually like their pets and enjoy their company and would like that to be mutually and not forced. Maybe people, like George Harris didn't fund Monty Python's movies for dollar signs in their eyes but because they actually wanted to see the movie being made. Like maybe it's not power but curiosity, acceptance and urge to help people and make interesting and nice things happen, that motivates them and so they don't just end up using their power to gain even more power.
Like technically automation could usher in a utopian era, where people don't do things because they have to, but because they want to. Because the things that actually need to be done could be automated or done in less time and with less people. So working hours could drop, people could enjoy their lives and follow their passion, rather than having to follow someone else's.
Like the thing that makes automation doom and gloom is the fact that money and in consequence the ability to be able to make money is the entry card for participation in society. So if you don't have money and can't make money you're outside of society and outside of the "civilized" world that makes all these wonders possible. So if the ability to enter is barred, or the bar is raised, that is what people are afraid. And that fear is quite real if you have an increasing standard of living, still a necessity to work full time to accomplish that and if companies have an incentive to hire as few people as possible to do the job.