I do not understand why you are being downvoted, but one look at other industries tells you that you are right.

First, older developers will be mercilessly fired and replaced by developers in India. There is a growing cohort of older developers who are perfectly content to come in and do mundane software development work in India. They have the experience, and with the way America is treating its legal migrants, there will be a huge pool of developers who have cut their teeth on projects at leading American software companies who will be living out the twilight of their careers in India. For the current cohort of Indian Software Developers at American companies, a path to permanent residence and citizenship is 50+ years out. They all know this and have no plans to remain in America indefinitely, but will actively return to India, but not before lining up lucrative positions working for American companies first, perhaps also taking away whole chunks of work to supervise with them.

Second, there is a growing awareness of development methodologies, cutting-edge technologies, and most importantly, cloud computing facilities located in India and growing cheaper by the minute. Developers joining the workforce today are much more suave and conversant with the latest technologies, and it's no different in India. As a bonus, many are perfectly happy to do mundane software development tasks that junior devs here are loth to do.

Third, the exact opposite timezone of India is an advantage: it works pretty much like a factory that runs two shifts that effectively halves time-to-market, which is a potent advantage that will not be turned down by a company once its competitors start seizing it.

Fourth, companies are beginning to seek out developers who have expertise in the industry in countries that have highly-developed niches in the industry. An example is biology, medicine, and bioinformatics. There are heaps of extremely-qualified Oxford and Cambridge graduates in England who are very happy to just take responsibility for entire lines of business (although they do suffer from an extremely awkward time difference with the west coast that works to their disadvantage). It is also happening with finance, to a certain extent.

The number you have mentioned, of 5.2 million software developers is absolutely staggering. Even if 10 percent of them turn out to be as good as the best of the American workforce, it easily eclipses the cream of the crop here by a comfortable margin. This is combining with the move out of large cities in India to smaller towns where the cost advantage is even higher, which all but guarantees that there will be companies that will want to take advantage of that.

Finally, there is a growing realization that globalizing indiscriminately, particularly to autocratic countries that have the potential to be formidable adversaries was very short-sighted and has created intractable political problems. The people in power have taken notice of this and will likely not want to put themselves in this position again. Younger leaders are all coming up in a time of brazen malfeasance by these autocrats, which also ensures that democratic countries will have a slight edge.