The British Government bases its legal claim to Gibraltar on the Treaty of Utrecht 1713 - so this year is the 300th Anniversary of the colony. We won in the War of the Spanish Succession and Gibraltar was part of the Booty.
So here we are in 2013 basing a claim to an enclave across the ocean on having beaten the Spanish in 1713: "We won the War, so Tough". We don't nowadays say that to Germany, so what makes us think that it's a good argument to use with Spain? After all, Spain is also a member of the European Union and allows many thousands of UK citizens to buy homes and live in Spain and many more British citizens to holiday there, unmolested.
We prefer Gibraltar to amicable relations with Spain because it controls the entrance to the Mediterranean. That used to be very useful in war time, especially if Spain was neutral (World Wars One and Two) or potentially on the other side. Actually, whether or not we can now use the Straits in war time depends on the Americans not on Spain. This we have known since 1956 when the US (Eisenhower, Republican - those were the days) pulled the plug on the Anglo-French-Israeli invasion of Egypt. Straits or no Straits, we can't go to war any more unless the Americans at least tolerate it.
It may be that the Americans prefer us to hang on to Gibraltar - they probably reckon we're a more compliant touch than the Spanish. We will let them land planes, dock ships and install listening posts on the Rock. But if the Americans change their minds and conclude that Gibraltar should go to Spain, then probably it will go to Spain.
That would be tough for the on-line British gambling businesses who have installed themselves there, not to mention the money launderers and the gun-runners and ... well, all those activities which drive up local property prices so that ordinary Gibraltarians find themselves forced to live over the border in, er,Spain - hence the importance of the border crossing. Gibraltarians commute to work cross that border. So do Spaniards, in quite large numbers: the Gibraltarian economy is bigger than Gibraltar. That's the general idea of such enclaves, as Spain knows from its own African enclaves of Ceuta and Mellila.
The Treaty of Utrecht also ceded Minorca to Britain. We had more difficulty hanging on to this and ceded it back in 1783 by the Treaty of Versailles and back once again in 1802 by the Treaty of Amiens. We weren't doing very well in the fights we were picking at that time. Yes, but if we got it Fairly by the Treaty of Utrecht then it was Unfair that it was taken away from us in 1783. Think of all those poor Minorcans born between 1713 and 1783 who grew up thinking that they were Brits, born to celebrate the birth of royal babies on their postage stamps (if they had had postage stamps then). How cruelly we abandoned them!
Surely, Mr Cameron and Mr Hague, time to demand back Minorca so unfairly wrested from its rightful owner!
Finally, by the Treaty of Utrecht, the British got something much more valuable than Gibraltar or Minorca. They got the Asiento.
The what? They got the right to sell people as slaves to Spain's colonies. They broke the Spanish monopoly on supplying slaves to its own colonies and opened the trade to their own traders and their own ships. That's the kind of Booty you get when you win wars. The Asiento lasted until 1834, the British government assigning its trading rights to our South Sea Company.
Ain't British history glorious?