In the tenth century, in an effort to stop hostilities between their two countries, the English gave a Scottish king land in London with the provision that he build a castle on it and live there for a few months every year.
Seven centuries later, with the two nations united under one king, the land returned to English ownership.
In 1829, the London police took up residence on the land, which by then was known as Scotland Yard.
In modern usage the term Scotland Yard, also called New Scotland Yard, is often used as a metonym for the British Metropolitan Police, and occasionally for the entire UK police-force.