Now, as Lesotho’s story is being retold in many of the 17 other African nations suffering drought, the Trump administration in particular should pay heed to what Lesotho can teach us. Instead, it has announced that the United States will cut its annual contribution to the United Nations Population Fund, which promotes family planning. That reckless move — followed by the even more reckless withdrawal of the United States from the Paris climate agreement — could only increase the growing number of desperate migrants who for decades have been fleeing famine and war in too many corners of the globe.

Even with only 1.2 million inhabitants in 1974, Lesotho’s leaders saw the country was overpopulated. A 1966 British Colonial Office study estimated that the land could support 400,000 people at best — a number Lesotho had reached by 1911. The country had few resources, and erosion was carrying away vast amounts of topsoil while an annual population increase of about 2 percent created more mouths to feed. Lesotho desperately needed access to contraception, but aid organizations avoided getting involved because many Africans then saw birth control as a conspiracy of the rich to keep population numbers in check.

What’s happened since? On the surface, Lesotho could seem to be a demographic success story. True, its population has doubled, but its growth rate has fallen and now is flat.

This is not the typical “demographic transition” traceable to improved incomes. It is traceable to AIDS. The average life span of about 50 years, the second lowest anywhere, is roughly the same as it was 45 years ago. The rate of H.I.V. infection remains among the world’s highest, with nearly 23 percent of adults on antiretroviral medicines in 2014.