When Hong Kong was handed back to China on 1 July 1997, following more than 150 years of British control, the "one country, two systems" principle was established as the foundation of the relationship.
While Hong Kong is part of China, the policy has given the Special Administrative Region (SAR) a high degree of autonomy.
Here is a breakdown of how this unique system works.
What is Hong Kong's Basic Law?
The "one country, two systems" principle is enshrined in a document called the Basic Law - Hong Kong's mini constitution.
That came into effect on 1 July 1997, the day British rule ended and the territory was returned to China.
That agreement is only valid for 50 years.
Basic Law protects rights such as freedom of assembly and freedom of speech - neither of which exist in mainland China - and also sets out the structure of governance for the territory.
Hong Kong is ruled by a chief executive with support from a formal body of advisors, called the Executive Council.
The chief executive is responsible for implementing the Basic Law, signing bills and budgets, promulgating laws - declaring them as in effect - and issuing executive orders.
It also has a two-tiered semi-representative system of government: the law-making Legislative Council and district councils, as well as an independent judiciary.
How is Hong Kong's chief executive chosen?
The chief executive is elected by an Election Committee of 1,200 people, who are in turn chosen by representatives of various sectors in Hong Kong - who only make up 6% of the electorate.
The chief executive must be formally appointed to the role by the central Chinese government.
The Basic Law states that the "ultimate aim" is for the chief executive to be selected by "universal suffrage upon nomination by a broadly representative nominating committee".
This means that many in Hong Kong feel they were promised a level of democracy that has not been delivered.
What is the Legislative Council?
LegCo, as it is widely known, makes and amends Hong Kong's laws. It is made up of 70 seats. Of these, 35 seats are directly voted for by the public, in five constituencies.
Another 30 seats represent "functional constituencies" - these are voted for by smaller groups representing special interests, primarily businesses, banking and trade. Historically, these sectors have been largely pro-Beijing.
Five district councillors are also elected by the public to sit on LegCo.
How do Hong Kong's district councils work?
Each of Hong Kong's 18 districts has its own local council.
The district councils have very little actual power. They're primarily advisory, acting as the eyes and ears of the government at a local level, passing on information about public facilities and services and how funds should be used.
They also have access to some funds to spend on environmental improvements or community and cultural projects.
However, 117 of the district councillors also sit on the committee that votes for the chief executive, giving them potential for greater influence.
Elections take place every three years. In the 2020-23 cycle, there will be a total of 479 seats - 452 will be directly elected, and the remaining 27 automatically go to the elected representatives of Hong Kong's tiny rural populations.
How much control does Beijing have over Hong Kong?
Politically, a lot.
Under the Basic Law, Hong Kong's courts are responsible - "within the limits of [its] autonomy" - for determining whether the government's actions are legal.
But the National People's Congress Standing Committee (NPCSC) - China's rubber-stamp parliament - holds the ultimate "power of interpretation" of the law.
Since the handover, it has acted five times to interpret the law, most recently in 2016 when two pro-independence lawmakers modified their oaths of allegiance to China.
Following that interpretation, critics said the NPCSC was effectively changing the law, rather than clarifying how it should be enacted.
Beijing must also approve the chief executive appointment and controls Hong Kong's defence and foreign affairs.
There are also about 5,000 Chinese soldiers permanently based in Hong Kong. But they can only intervene in Hong Kong if China declares an all-out state of emergency or war, at the request of the Hong Kong government, or for the "maintenance of public order and in disaster relief".
Will the system last forever?
The freedoms enshrined under the Basic Law expire in 2047 and it is not clear what Hong Kong's status will be after that.