I'm reading the Romance of The Three Kingdoms right now, and I'm baffled at how powerless the late emperors of the Han Dynasty are. They don't seem to hold any real militar power; that is reserved to local warlords. How come they didn't have a retinue of soldiers back then to prevent from being captured by someone too ambitious in the Empire?
I hope you enjoy the novel! Will be focusing more on the history then the novel with the answer but hope it helps
Short answer: They did have real military power at the capital before the civil war but the chaos in the capital that led to the rise of Dong Zhuo, a child Emperor and the existence of warlords meant the Emperor no longer had such forces.
Part 1
Before the Civil War
Since the restoration of the Han by Emperor Guangwu, the Emperor's hadn't taken to the field themselves. It was expensive for an Emperor to be in the field, there was the security risk (which slowly over time also saw Emperor's going on less and less tours outside the capital regions) and quite a lot of the Emperors came to power as kids and died while fairly young so limited time to do so. The Emperor would sit at the capital, making decisions (if in power), providing an example to the nation, failing to produce heirs, possibly trying to overthrow their controller.
At the capital was the Northern Army and it's five Regiments of 700 men each: The Archers Who Shoot At Sound, the Footsoldiers, the Elite Cavalry, the Garrison Cavalry and the Chang River Regiment. These were the elite, dispatched to help raised armies against those outside the Empire like the Qiang and the Wuhuan, rebels and the like while always protecting the capital. The guards for the Emperor were ceremonially selected from the Gentlemen of the Household which were men under probation for service. There were also the usual guards under the Director of Retainers or the Colonel of the City Gates or three thousand under the Minister of the Guards for the palaces or eunuch guards under the Minister Steward. There were guards and in a crisis, an Emperor might press them into service but they were not professional soldiers.
If you tried to raise troops against the Emperor, say as an overambitious Inspector (there were no warlords till the events of 190), you might have trouble. Provincial troops were for guarding, for security and for beating the odd rebel or bandit, you would have to supplement them with levying the peasantry. Retainers and raised troops might have some who had fought but family retainers experience mostly would have been vendetta's or local bullying, not real combat experience.
The other local officials would use those under their command and their levies to hold you. The Han could then dispatch someone with raised troops with some of the Northern Army, using equipment from the imperial armouries and maybe even hire some Wuhuan or the like troops to add to their numbers. The Han would be able to raise a force with professionals and equipment while the passes around the capital could be used to act as a defensive screen if your revolt was a little too close to home for comfort.
Or if a mass revolt as in the Turbans of 184 the scale of the peasant revolt may have scared the Han and provided an evocative opening but the Han put it down by the end of the year. The size of the Turbans revolt was no match for three Han armies with reinforcements, professional troops and equipment.
So why did this not work for the warlords that emerged in the three kingdoms? Chaos in 189 and then who ended up in control.
Chaos at the capital
Emperor Ling died on 13th May 189 and the novel mostly covers most of what happens. Jian Shi/Shou (a eunuch who Emperor Ling had created a new army just the previous year as the counter to the He's) and the Dong family troops went to General in Chief He Jin and half-brother He Miao (who had fought against the Turbans) as He family beat their political opponents and got Bian onto the throne. The Northern Army and all the professional soldiers were now in He hands.
The man in charge of the Northern Army would normally be the General-in-Chief, always an in-law to the Emperor. Tied by marriage to the crown, giving him major political status as they ranked with the Excellencies and in a regency (of which the Han had a lot), provided backing to the Dowager or took control of power themselves as a controller of a child Emperor.
The actual military side of such a rank wasn't a priority. Dou Xian had fought against the Xiongnu but in 92 returned to the capital and was arrested as Emperor He overthrew the over-mighty family. He was a rarity, most General-in-Chief's used it to appoint allies to key positions in the army then left the running to the military men, this proved useful for various Han Emperors seeing to overthrow their controlling in-laws as the army tended to abandon the General.
However He Jin was unusual, not from the normal families, he had busied himself in winning over the troops which may have been partly why Emperor Ling had created a second army under Jian Shi to balance him. That soldier's popularity also attracted attention from the opponents of the eunuchs who saw a golden opportunity to get rid of their rivals. There would surely be no repeat of last time when gentry coup under Dou Wu and Chen Fan had seen soldiers desert because the eunuchs brought in a popular general, a confused Zhang Huan who was visiting the capital.
As negotiations in the eunuch vs gentry lastest battle with the He family split, He Jin (who refused to carry out ideas to invade the palace or murder people) took one piece of Yuan Shao's advice: some of his officers like Bao Xin and Ding Yuan were sent out to raise troops (Ding Yuan also setting the town of Mengjin on fire) and Dong Zhuo summoned from the frontier. This was to put pressure on the eunuchs and the Dowager, this provided a fire show and, along with other measures, did initially cause some wavering but the arrival of outside forces would have repercussions later.
When He Jin was assassinated, the Northern Army were less than happy and they were happy to join He Jin's officers in launching an attack on the eunuchs. The eunuchs, their servants and their guards put up a fight but eventually, the professional soldiers broke through, thousands were slaughtered, the imperial family put to flight and the palaces looted. During this, He Miao had been killed having joined Yuan Shao and co to avenge his half-brother for which Wang Kuang and Dong Min helped kill He Miao for earlier siding with the eunuchs.
As the imperial family returned to the capital, things were in flux. The Northern Army had lost its two leaders, several of the palace guards had likely been killed in the fighting. The experienced military man Ding Yuan, with his own recently raised troops, was placed in charge of the city guards as Bearer of the Guilded Mace but who would take control of the Northern Army? Emperor Bian was not yet of age, had just been through a shock and under Regency, Dowager He was a woman whose ability to assert power had been rather curtailed by recent massacres.
Dong Zhuo, who had seen the flames and arrived into the capital to find chaos, was not overly impressed by the gentry. With three thousand under his personal command, he sent some of them out each night to return each morning in a huge display as if Dong Zhuo was being reinforced. People became convinced Dong Zhuo had a large army so the Northern Army slowly went to join Dong Zhuo. Dong Zhuo then arranged the assassination of Ding Yuan, the only man with a potential military threat in the capital, via his subordinate Lu Bu.
Dong Zhuo's appeal would also have benefited from something not covered by the novel: Instead of a corrupt inept figure, Dong Zhuo was a famed commander known to treat his men generously. He had fought for years against the Qiang and though he did badly against the Turbans, one of the few bright spots in Han's struggles against the Liang rebels. The Han lost control of Bing and Liang over years of fighting from 184 onwards, the novel leaving it out for a few potential reasons. During that war, Dong Zhuo had been part of or the main one in several of the Han forces victories and, when trapped due to bad orders from his commander Zhang Wen, he managed to get them all out safely after using fishing to hide his intent to lure the Qiang into dropping their guard.
The capital army was now in the hands of Dong Zhuo, a man who had once refused orders from Emperor Ling's court to leave his army, a man with no ties to the throne and who had considerable pull with an army. The young Emperor Bian (either seventeen or thirteen depending on the source) was not going to be in control of them. Or, given he was deposed very quickly, the even younger Emperor Xian at the age of nine. Forever after, the troops would be under the controller of the Emperor or specific generals.
It wasn't always like that but it devolved to that state within a couple of decades of mismanagement which particularly accelerated during Rebellion of Yellow Turbans when in less than half a decade it went from Emperor being nominally the only guy who could officialy raise troops to essentially a patchwork of warlords with private armies.
Interestingly enough Han Empire was not a feudal state when 180s began. It was at least nominally a centralized state with a standing army which was conscription based while provincial inspectors and commanders of commanderies were sent from the capital to govern. This came as a result of early Han crushing feudal princedoms and several rebellions thus monopolizing military power in 2nd century BC.
In practice it was a bit different. On lower administrative level below the commandery, in counties and marks, there already existed entrenched hereditary clans of land owning magnates often ruling those smaller units in all but name for generations. When a new young administrator was sent to govern, say a county (marks were already semi-feudal fiefs), local magnates would easily push him around because after all it was just a notch in his career and he would go away after a few years so why make problems for himself. Similar things often happened on commandery and sometimes even on provincial level. Few were brave enough to root out corruption and many in fact joined in with the magnates in squeezing the peasantry. Still these magnates and marquises could not raise their own private armies at that point, only small retinues that served as bodyguards. Inhabitants of local communities could gather into militias in case of emergencies for self-defense but they were to be quickly disbanded after danger was over. Ruling elite often feared to arm the peasantry.
Factionism at court, dynastic and institutional rot were long lasting at that point. Emperors were enthroned as children and died young in four successive generations which made them easy to control and manipulate. Access to emperors was first controlled by families of Empress dowagers (who had the duty of picking successors) such as Liangs, and in turn confucian scholars and administrators. These cliques usually intentionally picked young boys from collateral lines of Han to succeed because they had no allies and then kept them isolated. Cut off from the outside world emperor Huan was aware of his weak position so he turned to palace eunuchs (who were the only group with which he had contact) in order to reestablish his power and remove Liangs. After regaining control, grateful for their service he empowered them however once he died eunuchs took control of his successor emperor Ling. Tug of war between eunuchs and scholars/gentry over control of the emperor and court went on for decades (of which I'd gladly write about in detail sometime ;) )
In addition to that realm was also struck with combination of natural disasters,famines and plague as well as horrible mismanagement which left the treasury empty by late 170s so when a disaster struck they took urgent "innovative measures". Need to rebuild a palace but have no money? Why lets sell government positions to rich people? What, you say those guys embezzled funds intended for the army and are overtaxing provinces in order to make up for their investments? Lets make those people millitary commanders. Wait our shoddily equiped, poorly led army lost against Xianbei and now we have to rebuild it from scratch? Why lets spend funds intended for famine,flood and disaster relief in order to reform and requip the army. Oh famine, tsunami and plague struck and you mean to say we spent money intended for relief and now people are starving? Ah dang it...
Many of decisions such as these were driven primarily by rationale that outmaneuvering opposing court faction was a priority instead of longterm strategic goals to the benefit of Empire. Also in addition to all those abuses of power and disasters, similar to year 1000 Ad or 2000 in the west ,a new era was approaching and a lot of "milleniary" cults appeared awaiting sort of end times, like mostly taoist yellow turbans.
It didn't help that due to horrible factionalism, corruption and court politics the most talented commanders and intelectuals learned it's best to stay well away from Luoyang and imperial court. At best your talents and honesty went unappriciated if you didn't say the right things or had right connections. At worst it could get you killed. Factionalism had deep and long roots by that point. Men of talent and ambition like Cao Cao would have rotted away in some backwater (or literally) in such a system of negative selection if disaster hadn't struck.
In 184 AD Imperial army was just 10 000 men strong with only several experienced commanders and had to face between 360 000 and 2 million (less likely) rebels. For his own survival Emperor had little choice than to allow local magnates, volunteers and opportunists to raise private armies and militias. Most of heroes of ROTK began their way to power that way. Of course they were supposed to disband these forces once rebellion was quelled but most didn't.
In 187 AD pressured by both external (invasions of Qiang and Wuhuan) and internal (widespread revolts and banditry) turmoil Emperor Ling essentially legalized this situation by changing the nature of supreme provincial administrators from inspectors (who had very limited powers), to largely autonomous governors so they could (ideally) take more decisive actions in order to quell rebellions. Emperor also declared all existing militias to be formally part of Army of the Western Garden of which he was nominal supreme commander (this was partially done in an attempt to limit power of He Jin who was supreme commander of standing army).
After this there was no putting cat back in the bag. Two years later emperor Ling died and factions decided to go at each other's throat , Dong Zhuo was summoned to come to the capital with border troops and you know the rest...