Maybe a bit of history is in order. Not to seek an excuse for the excesses of the CAP, but to explain its motivations, at least the motivations of its main designer, Dutch Commissioner Sicco Mansholt.
During the winter of 1944/1945, there was a famine in the Netherlands, the "hunger winter", notably in the western urbanized area around the big cities of Amsterdam, Rotterdam and the Hague. The Dutch railways were on strike since Market Garden to support the war effort and the Nazis refused to run trains, so there was little transport of food from rural areas to the cities. Many city folk, like my mom and her siblings, went out on bikes on "hunger trips" for tens or even 100 miles to procure basic food like beans and potatoes from farmers. The famine cost approximately 22,000 people their lives, an unequaled occurrence in a rich, first-world country.
Mansholt was himself a rather well-to-do farmer and a social-democrat. He was active in organizing food supply to the starving city folk. And this famine has made a lasting impression on him and given him his main motivation, both in his job as Dutch Minster for Agriculture and later in his job as European Commissioner for Agriculture: never again hunger.
tbh a similar societal memory is one of the reasons why the agricultural lobby punches far above its weight in the UK. Our memory of World War II, rationing and hunger. and the sterling efforts of the British farmers, land girls and public have left a clear impression that the UK should not be (too) dependent on food imports and that agriculture is a crucial industry.
IMO the trouble is that this has led to a certain amount of "featherbedding" for large agricultural concerns whilst at the same time failing to support smaller producers. This in turn has led to large, profitable but comparatively non-innovating large concerns and individual farmers on the verge of bankruptcy.
IMO there isn't enough investment in UK "exotic" food production. The Netherlands should IMO be a model of what can be achieved with a so-so climate but good technology. The blame for all of this does not sit at the feet of the EU - but that's where successive UK governments of all hues have placed it.