In the late 200s, some time after the Jin took control, writer & historian Chen Shou would collect the history of the prior era of civil war into what is now known as Records of the Three Kingdoms, part of what's now called the Twenty-Four Histories of China. Then, sometime in the 14th century, writer & playwright Luo Guanzhong (or, at least, he's the one attributed) took Chen Shou's Records & retold the story of the "Three Kingdoms" in a more dramatic & romanticized fashion, resulting in Romance of the Three Kingdoms, the first of what would be considered the six "Great Classical Chinese Novels". Starting at the Yellow Turban Rebellion, Romance focuses primarily on the three warlords who would come to form the titular Three Kingdoms of China: Liu Bei of the Shu Han, Cao Cao of the Cao Wei, & Sun Quan of Eastern Wu. Each of these three warlords had (somewhat) legitimate claims as to why they should be the one to rule over all of China, as Liu Bei was seemingly a blood descendant of Emperor Jin (who ruled from 188-141 BC), & all Liu Bei wanted was to continue the legacy of the Han. Meanwhile, Cao Cao never truly staked a claim over rulership, as he made sure the current Han dynasty was still intact during his conquests & was technically acting on behalf of Emperor Xian, mainly for political reasons. It would be Cao Cao's son, Cao Pi, who actually ended the Han dynasty & established Wei as a kingdom, following his father's death. Finally, Sun Family patriarch Sun Jian had managed to come across the Imperial seal after it was hidden away, which would technically give him power to make official decrees, but through a series of circumstances the seal would eventually wind up with Cao Pi, who used it to legitimize Wei's stance as the "true" successor to the Han. Sun Quan, one of Sun Jian's sons, would initially agree to serve as a vassal of Wei, but eventually broke free after Cao Pi ordered that Quan send his son Sun Deng to the capital as a hostage. Essentially, Liu Bei had the royal lineage, Cao Cao had the Imperial capital (& the Emperor himself), & the Sun Family had the Imperial seal (for a time, at least).
Romance is notable for fictionalizing many aspects of the historical figures & events seen within, like having Liu Bei make an oath of brotherhood with Guan Yu & Zhang Fei in a peach garden (while the three were known to think of each other as brothers in actual history, the peach garden oath in generally agreed to be pure fiction), as well as softening some of the less honorable aspects of the various generals & warlords seen throughout, i.e. romanticization. Romance of the Three Kingdoms remains an all-time classic of an epic novel (around 800,000 words across 120 chapters), and its reach across the world is immeasurable... especially in Japan.