Capitalism is based on a false hypothesis, which is you will need plenty of offer to supply demand.
But as technology improves, you will need less and less people working to supply what is needed. As result you get to the point where most people cannot find a job, so there is also nobody that can buy products.
Companies have been working around this problem for about a hundred years by making products that aren't really needed, convincing people to buy them, and making them weak so they break down soon.
But as a side effect natural resources has been depleted, so once they become scarce the system is done. People would need to think in new ways of interchanging work appart from money.