The British adopted contradictory policies in ruling their newly acquired Cape Colony in the first three decades of the nineteenth century. Having seized the Cape from the VOC in 1795, the British returned the colony to the Dutch government in 1803 when peace had been concluded with the French. In 1806, however, with the beginning of the Napoleonic Wars, the British again took the Cape in order to protect the sea route to their Asian empire. Like the VOC before them, the British tried to keep the costs low and the settlement small. Local officials continued the policy of relying on imported slave labor rather than encouraging European immigration with the latter's implication of permanent and expanding settlement. They also introduced racially discriminatory legislation to force Khoikhoi and other so-called "free" blacks to work for as little as possible. The Hottentot Code of 1809 required that all Khoikhoi and other free blacks carry passes stating where they lived and who their employers were. Persons without such passes could be forced into employment by white masters.
The British attempted to alleviate the land problems of Boers in the eastern Cape by sending imperial armies against the Xhosa of the Zuurveld (literally, "sour grassland," the southernmost area of Bantu-speaking settlement, located between the Sundays River and the Great Fish River). They attacked the Xhosa from 1799 to 1803, from 1811 to 1812, and again from 1818 to 1819, when at last, through ruthless warfare, they succeeded in expelling the Africans into the area north of the Great Fish River. Thereafter, the British sought to create a fixed frontier by settling 5,000 British-assisted immigrants on smallholder farms created out of land seized from the Xhosa south of the Great Fish River and by clearing all lands between the Great Fish River and the Keiskama River of all forms of African settlement.
But other policies and developments worked against these measures.