Also the world's population is already too large and unsustainable in terms of resources. What will happen in 20 years when AI has taken the jobs of many workers?"
The world's population is large, but birth rates are either stagnant or falling. By 2050 then number of people in the world over the age of 60 will be 2.1 billion and those over 80 will be 434 million. These are over 50% increases in a matter of decades.
By 2030, older persons will outnumber children aged 0-9 years (1.4 billion versus 1.3 billion); by 2050, there will be more people aged 60 years or over than adolescents and youth aged 10-24 years (2.1 billion versus 2.0 billion).
Moreover, those over 60 are living longer, healthier and more productive lives than previously (which also accounts for the rising population in spite of falling birth rates), and many are not retiring at 65 as they did previously, so there is less turnover in employment, which means the younger population is not climbing the wealth ladder as quickly as their parents did.
All of this will right itself after 2050 when the population should start declining steadily to more sustainable numbers, and employment rates increase (even with the creation of AI's, which will actually create industry, rather than take it away).
Is the GenX/Millennial population somewhat fucked due to all these old folks we're going to have to support? Yes, though it should start getting progressively better. Will our kids be in a good position, yes, they should find a better employment market and more money for healthcare.
There will be no massive war (unless Trump can start one in the next few years), there will just be an economic and population leveling out.