At the recent IAAF World Championships in Athletics, Hong Kong and the P.R. of China had separate teams in the 4x100m relay. I understand why the PRC and Chinese Taipei compete separately, as they are de facto separate countries, but why does Hong Kong have its own team?
The main reason is that Hong Kong is a Special Administrative Regions of the People's Republic of China (Similar to Macau).
Hong Kong was a a British colony until 1997 and then moved back to China according to political agreement under "one country, two systems" principle.
As a result Hong Kong has its own flag, currency, judgement system, immigration and many more attributes of independent country system. Only the military system and the diplomats relationships are managed under the Chinese authorities.
Hong Kong also has Sports Federation and Olympic Committee which is the national Olympic committee (NOC) of Hong Kong. As such it is a separate member of the International Olympic Committee (IOC) and compete separately on the olympics and the IAAF World Championships.
Because it is one of autonomy traditions of Hong Kong. Before 1997, Hong Kong already has its own flag, currency, sport team, immigration and many more attributes of independent country system.
Hong Kong was a royal colony which were ruled by a governor appointed by the monarch, not under the England nor UK government.
After 1997, the Chinese-British political agreement under "one country, two systems" principle means to not change them, and that Hong Kong should be self-governed.