A quick history lesson, mostly cut and paste from various sources to save time:
1842: Hong Kong Island ceded to Britain. In the Treaty of Nanking, the Qing government agreed to make Hong Kong a Crown colony, ceding it 'in perpetuity', following British victory in the First Opium War
1860: Kowloon south of Boundary Street and Stonecutters Island ceded to Britain. During the second half of the 19th century, Britain had become concerned over the security of the isolated island, Hong Kong. Consequently, in the Convention of Peking, following British victory in the Second Opium War, Britain gained a perpetual lease over the Kowloon Peninsula.
1898: Britain signs a 99-year lease on the New Territories, which are around 12 times the size of what it already had, in order to bolster defences against other European powers like France and Germany. Claude MacDonald, the British representative, picked a 99-year lease because he thought it was "as good as forever". Britain did not think it would ever have to give the territories back. The 99-year lease was a convenient agreement.
The New Territories, with a 99-year lease, were the only territories forming the Crown colony of Hong Kong, that were obliged by agreement, to be returned. However, by the time of serious negotiations for the return of the New Territories in the 1980s, it was seen as impractical to separate the ceded territories and return only the New Territories to China, due to the scarcity of resources in Hong Kong and Kowloon, and the large developments in the New Territories. In 1984, the U.K. and China signed the Sino-British Joint Declaration outlining their plan for Hong Kong. This declaration stipulated that Hong Kong would become a part of China on July 1, 1997, but that the “current social and economic systems” and “life-style” in Hong Kong would remain the same for 50 years. In this “one country, two systems” arrangement, Hong Kong would continue operating in a capitalist economy, and residents would continue to have rights to speech, press, assembly and religious belief, among others - at least until 2047.
Consequently, at midnight following the evening of 30 June 1997, the entire crown colony of Hong Kong officially reverted to Chinese sovereignty, ending 156 years of British rule.
Now, the argument is that China is reneging on the terms of the Sino-British Joint Declaration of 1984, with still 27 years to go until 2047. And so the question is, what does Britain have to say or do about that? Those 2.5 million people in Hong Kong who do not hold a BNO passport but are eligible for one are eligible because of the history laid out above.