The ISO 4217 currency codes [1] look pretty arbitrary too. For example, why is the Afghan afghani "AFN" instead of "AFA", or the Japanese yen "JPY" instead of "JAY"?
It's JPY because the ISO 3166-1 alpha-2 2-letter country code for Japan is JP. Similarly, it is GBP because the ISO 3166-1 alpha-2 2-letter country code for the United Kingdom is GB, not UK. ISO 3166-1 alpha-2 is used everywhere, for example on the web for ccTLDs (although the UK is an exception, since it has GB allocated, but for backwards-compatibility with another network, it also got UK, and now disallows registrations on GB).