I've seen a lot of 'crown princes' in my research, and while it's usually the eldest son it's not always. I'm just wondering how a 'crown prince' or heir apparent was chosen in Ancient China.
My familiarly is with the end of the Han and of the three kingdoms, others may be able to provide a wider answer.
Assuming the Emperor has a son (not often in the Latter Han's case, they went several Emperors without a son), it would be one of them, continue the mandate, clearly legitimate. The eldest had an advantage of being the stable choice, the quickest to have come of age, been at court and might have built support (and if not yet, quickest to be old enough to build support), the strongest claim. It didn't have to be the eldest, another son's talent and morality might make him the best choice, the one who can truly lead, the one the mandate of heaven would be for due to need for virtue, particularly if the father has doubts about the quality of the eldest.
Competing claims could take up attention at court until one was decided (hopefully). In theory, an Emperor installed chosen son as Crown Prince, this is my heir, make it very public and clear, with (ideally) the mother as the Empress and possible future Dowager. Maybe kill a few key supporters of the failed heir (or the potential rival heir even) just to make things safe for the chosen one. All sorted. In theory.
In practice? Rulers and warlords did not always prepare the ground. Emperor Ling favoured his second son Liu Xie (the future Emperor Xian) over his eldest Bian but never got round to making formal heir before he died. So it ended up with the supporters of the two candidates political playing to get their candidate in (the Dowager He and family got her son Bian installed) after Ling died.
The first Wei Emperor Cao Pi only installed his only son Cao Rui as heir at the last moment having failed to produce other sons (also killing Rui's mother Zhen years earlier) before becoming mortally ill. The northern warlord Yuan Shao didn't get round till either not at all or on his deathbed when he named his third son (and possibly youngest) Shang as heir, he had made moves to disinherit his eldest Tan earlier but it was a shock when Shang became ruler on Shao's death. Tan was not overly happy at this shock discovery, nor were his supporters and there were accusations Shang's supporters forged Yuan Shao's will.
When the succession was up for dispute, the supporters of the eldest (examples Ju Shou for Tan, Jia Xu for Cao Pi, Lu Xun for Sun He of Wu) would argue the eldest provided stability and uncertainty or dispute successions from picking the younger caused chaos, that the division wouldn't end well. It was an argument that sometimes held sway, Cao Cao would eventually choose his eldest living son, but a father deciding who was the best son for the path ahead (or who might have been bigger backing of the powers at court) was never far from impossible. Emperor Ling intended but never got round to it, Yuan Shao did it or meant to do it, the Jing warlord Liu Biao chose his second son Cong over eldest son Qi.
When the heirdom became disputed, it could get messy. Senior members of the court saw it as a state matter (not something a ruler always agreed with), they would get dragged in. Yuan Shao's officer core became riven by disputes, distrust between the factions built and his sons would end up fighting each other which allowed Cao Cao to destroy them. The Wu Emperor Sun Quan lost his eldest son and Crown Prince Sun Deng to illness, made his next living son Sun He Crown Prince but the next son Sun Ba provided a rival, Quan's daughters joined opposing camps and his officer core split, rumours and accusations flew, Sun Quan's temper frayed, a lot of officers ended up disgraced or killed, Sun He was exiled, Sun Ba was killed and the youngest son Liang was made Crown Prince.