The scene from the preschool in the Chinese county of Suinin, approximately halfway between Beijing and Shanghai, could have been an advertisement for cuteness. Two lines of children walk out of school at the end of the day, led by their beaming teachers towards a cluster of expectant parents. Mara Hvistendahl witnessed this scene but when she did, she noticed a strange phenomenon: there were nearly twice as many boys in the two lines as girls.

The situation in Suinin is hardly unique. Across the developing world, from China to India to Eastern Europe to the Middle East, sex ratios - the ratio of boy babies to girl babies - are becoming increasingly skewed. The normal human ratio is around 105 boys for every 100 girls, a natural evolutionary ratio that takes into account the fact that more boys tend to die before reaching adulthood. But in China today, the ratio is 121 boys for every 100 girls; in India the ratio is 112 boys for every 100 girls; in Tunisia the official ratio is 107 boys per 100 girls, although the real figure is believed to be much higher.

In her thorough and compelling new book, Unnatural Selection, Hvistendahl explains why these trends will have far-reaching effects. She argues that the sex imbalance could prove devastating to social stability across the developing world, sparking crime, human trafficking, and - if history is any guide - even war.

Some societies have long held preferences for boys. In China, boys historically helped ensure that rural families would have a steady supply of labour to work on their smallholdings. In India some higher castes have historically practised infanticide of baby girls to ensure the family had boys, who were regarded as critical to economic survival and also to ancestral rites. In Vietnam, many families traditionally preferred boys for similar reasons of economic productivity and ancestor worship. But to her surprise, once she began investigating skewed sex ratios, Hvistendahl found that it was the wealthiest and most urbanised parts of the developing world, cities such as New Delhi and Tunis, that had the most unbalanced ratios of baby boys to girls. India's latest census shows an increasingly skewed sex ratio in all but eight of the country's 35 states, including many of its richest regions.

The fact that sex ratios were growing more imbalanced in even these more affluent areas gave the lie to the idea that traditional preferences for boys were responsible for skewed sex ratios, and would vanish as societies modernised. Instead, in these wealthier regions, the meeting of traditional preferences and new technology - principally, cheap and highly effective modern ultrasounds - has been a dangerous combination.

In some developing nations, it is illegal to use ultrasound scans to find out a baby's sex to then abort it. Hvistendahl finds that small bribes easily persuade ultrasound technicians to skirt the laws. In other developing nations, such sex selective abortion is not illegal anyway. In clinics in New Delhi, Hvistendahl finds that selective abortion has become big business. The hospitals advertise their gender selection services to India's wealthiest parents, and women often use abortion as a kind of contraception, becoming almost blasé about the procedure. One obstetrician there tells Hvistendahl that for some of his patients an abortion is "like having a cup of coffee".

Changes in technology, however, are not the only answer. Though the book is occasionally clumsy, Hvistendahl delivers serious investigative work. She finds that the population control policies of the 1950s and 1960s, captured most notably in the best-selling book The Population Bomb, unwittingly sparked the growth of sex-selective abortions and subsequently skewed birth ratios. At that time, many demographers warned of a Malthusian future in the developing world, whose rising populations would exceed the Earth's ability to provide, leading to a vicious competition for food and other dwindling resources.

These predictions proved wildly off - successive agricultural breakthroughs helped ensure that food production yields rose exponentially - but they made their mark, too. Fifty years ago, many of the leading western foundations and politicians advocating population control either implicitly or explicitly endorsed sex selection as a means of cutting down births, since having more men meant fewer chances of pregnancies.

With its "one child" policy, China took the concept of population control to its extreme. Across the People's Republic, Communist Party officials pressured women to have only one child, forcing them to abort if they broke the law.

Today, skewed sex ratios appear to be getting worse. What will become of the millions of "surplus men"? Their future could be very grim. Marriage, scientists have found, actually makes men more peaceable - it lowers quantities of testosterone, thereby making men less likely to attempt risky behaviour, and seemingly calmer and less likely to be depressed. Scientists have found that single young men are far more likely to commit violence than their married peers, and are more likely to be in poor health. Already, parts of India, China and other countries with skewed sex ratios have witnessed higher rates of crime, a result in part of angry and bored young men looking for outlets for rage. In China, surplus males increasingly congregate in certain areas of cities - train and bus stations are favourites - and have begun to form gangs.

In the worst nightmares of the authorities in Beijing, these angry young men could turn against the state. Within a decade, China could have 30 million men who cannot find wives, and similar skewed ratios will plague many other developing countries, including tinderboxes like Pakistan and Tunisia. It is too soon to tell how sex ratios affect the Middle East, but history shows that a surplus of men often sparks attempts to topple the government, and certainly large numbers of angry young men have led the front lines of revolts from Libya to Syria to Yemen, as well as manning the ranks of terrorist groups such as al Qa'eda. As the scholars Valerie Hudson and Andrea den Boer earlier claimed, in the mid-19th century unequal sex ratios, which left men idle, contributed to armed rebellion in the Chinese countryside that ultimately led to the overthrow of China's last emperor.

Surplus men will not mean an easier life for women, either. In theory, skewed sex ratios might make women more desirable. But so far, just the opposite has happened. In places with the most skewed sex ratios, "honour crimes", such as the killing of sisters who have supposedly dishonoured their family, have increased. Across developing nations, the skewed sex ratios have fostered a rising trade in girls and young women, either through bridal agencies that match them voluntarily to foreign men or, too often, through criminal syndicates that kidnap girls to sell them to suitors in other countries. In Thailand, where I have worked for years, 160,000 women and girls are trafficked each year, often subjected to repeated rapes, as well as beatings and even murders. In China, Hvistendahl finds, syndicates grab girls in counties with more equal sex ratios, to sell them to men in places where there are fewer young women. The authorities pay little attention to the problem.

Are bachelor nations inevitable? Not necessarily, at least over the long term. Developing countries from the Middle East to Asia could create better social safety nets, reassuring parents that they will not need sons to support them in their old age; governments also could take concerted measures to raise the status of women, such as educational campaigns to teach people to protect girls and stricter monitoring of obstetricians and ultrasound technicians. Still, Hvistendahl suggests that, in many countries, the die is already cast: the trends that have skewed sex ratios will take at least a generation to correct, even if governments take steps to address them.

Joshua Kurlantzick is fellow for South-east Asia at the Council on Foreign Relations.