For Foreign Affairs. The next several decades will see populations in Europe and North America age and shrink as people have fewer and fewer children. That trend will hurt economic growth and dynamism and leave too few workers for every retiree. Robots and artificial intelligence will not save rich countries from the economic consequences of a shrinking population. Nor, without a dramatic reversal of current policies toward immigrants, will a flow of workers from elsewhere. To avoid sclerosis and decline, the rich world will have to compete to attract immigrants, not turn them away.