KAMPALA, Uganda—Across Somalia, desert locusts in a swarm the size of Manhattan have destroyed a swath of farmland as big as Oklahoma. In Kenya, billions-strong clouds of the insects have eaten through 800 square miles of crops and survived a weekslong spraying campaign. In parts of Pakistan, the pests have eaten 40% of the harvest, forcing the government to declare a national emergency.

The worst plague of locusts in generations isn’t over yet, but the gargantuan scale of the damage it has wrought is coming into focus and...