It used to be a satellite state under the Central Plains Dynasty of ancient China, or a small country that bowed to the Central Plains regime, somewhat similar to the current autonomous government.
In the past, the Central Plains regime had a strong national power. While fighting in the south and north, it gradually discovered that it was easy to conquer a nation militarily, but it was very troublesome to completely assimilate and rule them. As a result, the system of local chieftains gradually formed, that is, the local government elected representatives or chiefs, ruled by itself, maintained its own way of life and customs, but recognized the Central Plains dynasty as the suzerainty and paid tribute regularly in order to achieve peace (a typical example is the former Dali Kingdom , there are many ethnic minorities in the southwest, and it is difficult for the Han rulers sent from the Central Plains to rule).
This is somewhat similar to the colonial system in modern history. For example, Britain once had the largest number of colonies in the world. Those colonies were deeply influenced by British culture, but it cannot be said that those colonies were British territories (such as Hong Kong, India, and even Australia). North Korea and South Korea used to belong to the same country. They were once called Koryo (Korea was transliterated from this, it seems). They had their own language. In the early days, they did not have their own written characters. They all used our Chinese characters. Later, in order to get rid of the influence of Chinese culture , only then did he invent his current phonetic writing, which is somewhat similar to the pinyin in our Chinese language. (Imagine, if we all use pinyin to represent Chinese characters, then there will be many, many accented characters. In fact, Korean is like this now. There are many homophones, which are difficult to distinguish. This is why most Koreans have their own corresponding Chinese characters. The name is not deliberately chosen as a Chinese name, but to distinguish the homophones in Korean, because the same Korean word may correspond to several meanings. For example, when we say the pinyin of "shang", they will have a similar "Shanghai" "Shang", or a Chinese equivalent of "Shang" in "Monk").