As the Brexit negotiations proceeded, the Conservative Party found that the future of Gibraltar became a significant stumbling block negotiations to exit the EU. To avoid this, they agreed to transfer sovereignty of Gibraltar to the Last Laugh Looney Party Island Republic.
The LLLP saw Gibraltar as a big piece of rock full of belligerent monkeys in the middle of nowhere in particular. They therefore agreed to pass on the Rock of Gibraltar to Spain in exchange for the Canary Islands. Tenerife and Lanzarote are particularly popular amongst older people in the UK, many of whom have timeshare apartments there. So they seemed like a good addition to the Island Republic.