From Imperial Twilight: The Opium War and the End of China’s Last Golden Age, by Stephen R. Platt (Knopf, 2018), Kindle pp. 112-114:
In the 1660s, the young Qing dynasty was just twenty years past its conquest of Beijing and still only partially in control of the empire. It faced a pirate navy of more than a thousand ships and 150,000 sailors that had declared open rebellion against the Manchus and called for the restoration of the Ming dynasty. Kangxi had just come to the throne, a mere boy at the time, and he and his advisers recognized that the dynasty’s Manchu forces, which were mounted on horseback, could not possibly hope to master such a large force of pirates on water. So rather than fighting them head-on, Kangxi instead ordered the evacuation of China’s entire southeastern coast.
Nearly a thousand miles of shoreline, from Zhejiang province in the east all the way down to Canton in the south and beyond, was emptied of its inhabitants so the Ming-loyalist pirate fleet would have nowhere to find supplies or conscripts. The evacuation began in 1661 with a zone three miles wide, increasing to ten miles the following year. Lines were drawn (soldiers stretched ropes to mark them), and the population living between the boundary lines and the shore were forced at spearpoint to abandon their homes and villages and move inland, carrying whatever of their possessions they could manage. Behind them, the farms were dug up and the fishing boats and villages burned, leaving nothing for the pirates to find on land except military camps.
The evacuation in the 1660s was horrific from a humanitarian standpoint: a forced relocation of millions of people, leading their farm animals on a slow exodus, carrying the elderly on their backs, into cities and inland regions where they had no land rights and no clear way to make a living. “There was wailing everywhere,” wrote an observer at the time. “The sight was too painful to watch.” But as a military strategy it succeeded. The pirate fleet, unable to obtain supplies on the Chinese coast, abandoned mainland China and sailed across the Taiwan Strait to conquer the Dutch colony that then existed on Formosa (modern-day Taiwan). The coastal evacuation order would be enforced in most areas for more than twenty years, which was how long it took for the Qing dynasty to build a navy sufficient to cross the strait and destroy the pirates on their new base. Once the pirate armada was defeated, the dynasty incorporated Taiwan into its empire and the millions of people who had been removed from the coast were finally allowed to return home.
That victory was so decisive and complete that China’s coast would enjoy a long era of peace afterward. Through the eighteenth century, the only real security issues China’s coastal communities faced were small-scale amateur pirates—poor fishermen, typically, who sailed up the coast to make trouble in the off-season when the winds wouldn’t allow them to go to sea. They hardly merited a centralized military response. In times of need, coastal communities raised their own funds to build watchtowers and guardhouses, and hired local police forces to protect their markets against the predations of bandits—local measures that, up to the early 1800s, were fully sufficient. By the time the new pirate confederation rebelled against the government, the dynasty had not needed an oceangoing navy for more than a hundred years and the ships it had built to conquer Taiwan had long ago rotted away.