Under the "one country, two systems" principle, Hong Kong and Macau have their own governments, legal systems, and economic policies that are distinct from those of the PRC. They also have a high degree of autonomy in internal affairs, including the right to issue their own currency, set their own immigration policies, and negotiate trade agreements with foreign countries.
The "one country, two systems" principle was first proposed by Deng Xiaoping in 1982 as a way to peacefully reunify China with Taiwan. Under this proposal, Taiwan would be allowed to retain its own government, legal system, and economic policies, while still being considered a part of China. However, Taiwan has never accepted the "one country, two systems" principle, and continues to maintain its independence from the PRC.
The "one country, two systems" principle has been successful in maintaining peace and stability in Hong Kong and Macau since their return to Chinese sovereignty in 1997 and 1999, respectively. However, the principle has also been criticized by some who believe that it gives too much autonomy to Hong Kong and Macau and that it could eventually lead to the separation of these regions from China.