Mauritius was convinced to sell these islands to the UK in 1965 under dubious circumstances: the sale was part of the independence negotiations (independence was achieved in 1968) and the prime minister of Mauritius who negotiated the deal was awarded a knighthood soon after the transfer.
The UK subsequently leased the largest island of the archipelago, Diego Garcia, to the US (who wanted it for a military base) partly in exchange for a discount on Polaris nuclear missiles. In preparation for the construction of the military base, the UK then proceeded to forcibly remove the islands inhabitants, dropping them off unceremoniously in the Seychelles and what was left of Mauritius.
Diego Garcia became an important base for the US, particularly so in the 2000s, when it served as a hub from which long-range bombers attacked Afghanistan and Iraq. The base has been used by the CIA for so-called ‘extraordinary rendition’ flights, and may also have served as a CIA black site prison.