Many Hong Kongers are actually descendants of mainland Chinese that fled China during 50s and 60s. My great grand father and grand father don't speak Cantonese or very little of Cantonese but didn't have much problem in Hong Kong before 50s or 60s as Cantonese was not the dominated language back then. At that time there is no such thing as Hong Kong identity. Hong Kong identity was really formed around 70s when the first generation of Hong Kong born Chinese emerged.
UK as the former colonial superpower was very good at divide and rule. Top officials are appointed by UK or filled by all British, the legal system is dominated by judges and lawyers from UK, best public schools were all Christian that are funded by the Hong Kong government, Chinese elites that behave are given the title of Justice of the Peace which help the UK government to rule and monitor any dissents. For anyone that wants to get promoted in the government government or success in the business world in HK, they all needed to seek approval from the UK or their White masters.
After a generation or two, this Master and servant relationship has fostered a new identity which is a sense of superior complex among people who are considered upper class, elites, that work under or associated with White people. At the same time, these people have developed an inferior complex as they have become house slaves after a few generation working under a superior race and master. From there, these Hong Kongers develop a form of superiority complex to look down other Chinese or inferior race. They consider themselves more civilized, Westernized, modernized, liberal and cosmopolitan.
During 80s and 90s, when Hong Kong emerged as world financial center, Hong Kong identity has become strenghtened. Many Hong Kongers even though middle class and lower class who once were suppressed began to adopt such new Hong Kong identity and superior complex.