Farmers argued that if the subsidies were withdrawn, many of them would go bankrupt. They say welfare and environmental standards are typically higher in the EU than elsewhere, so costs are higher. That means the subsidies continue, although they are now based on the size of the farm rather than the output.
Most farms are small but some wealthy landowners get more than £1m in subsidy from the EU.
Intensification of farming - encouraged by the CAP - devastated wildlife, with many populations of farmland birds more than halved since the 1980s.
The UK and others have pushed for farmers to be rewarded more for looking after wildlife, and the downward trend has slowed.
But the EU farm lobby is hugely influential, and in 2013 it managed to water down plans from the European Commission to oblige farmers to earn their subsidies by doing much more to protect wildlife.