The Second Battle of Cairhien was fought during the Shaido War of 999 NE. The 160,000 Shaido Aiel under Couladin, marching at a furious pace, had surrounded the city of Cairhien and besieged it, but the presence of not only native Cairhienin forces but also Tairen reinforcements sent into the kingdom at the order of Rand al'Thor prevented them from breaching the walls or capturing the city.
After the events at Alcair Dal, and the Aiel clan chiefs declared Rand to be the Car'a'carn, Couladin led the entire Shaido clan out of the Aiel Waste and into Cairhien. The Shaido laid waste to several towns and strongholds in eastern Cairhien, before reaching and beseiging the city of Cairhien.
Cairhienin forces, already weakened by famine and civil war, was hardpressed to defend the city. Despite the lack of miners and siege engines, the Shaido almost breached the city walls twice after burning the Foregate, the wooden section of Cairhien laying outside the citywalls.
Couladin had approximately 160,000 Shaido surrounding the city of Cairhien, including an unknown number on the Western bank of the River Alguenya to ensure no supplies would get to Cairhien. Because Couladin brought the entire clan across the Dragon Wall and additional fighters from other clans who reject Rand’s telling of Aiel history have joined the Shaido, his forces far exceeds that of the other individual clans.
Rand’s forces consisted of seven Aiel clans with roughly double the Shaido numbers. In addition, some Cairhienin and Tairen forces have also gathered to his banner including roughly 900 Tairen cavalry, a similar number of Cairhienin cavalry, and several thousand mostly Cairhienin foot troops.
A third force consisted of the four remaining Aiel clans. It roughly equaled the Shaido force in size, and stood apart from both sides. Their apparent lack of commitment to either side dictated the strategy employed by Rand’s forces; what may have been a straight forward confrontation to crush the Shaido forces instead became one to drive the Shaido away from Cairhien and north across the river Gaelin.
The battle plan was for Rand’s forces to be divided in two: one half is to engage the Shaido, the other half is to be divided into three parts, with one third to prevent the Shaido forces moving east and funnel them across the river, and the other two thirds divided in halves to guard against an attack by the unaligned clans.
Due to the hilly terrain of the region and the sheer size of the battlefield, the battle itself soon degenerated into smaller bands trying to maneuvre and engage each other among the foothills, rather than a straight frontal confrontation between the Shaido and Rand’s forces.
Rand al'Thor, who intended to lead the battle in the field, found himself coerced into helping from his observation tower using the One Power, alongside Egwene and Aviendha. Throughout the day, Rand was attacked sporadically by Sammael from the direction of Illian, but refrained from going after Sammael after being convinced he would be severely disadvantaged by his physical exhaustion and the possibility of traps set by Sammael.
Mat Cauthon, who had attempted to leave Rand's forces on the morning of the battle, found himself in a position of being able to either prevent the slaughter of some Tairen and Cairhienin forces who ventured into the battle against their orders, or watch it happen. Surprised and annoyed at finding himself doing the right thing, Mat rode to warn the allied forces. Using his position as a friend of the Dragon Reborn to gain the attention of the Tairen lords, Mat soon found himself put into a position of leadership. Reluctant but left with little choice, Mat led the combined forces against the oncoming Shaido forces using a double pincer manuvre, using the Cairhienin pikemen to hold the Shaido at bay while dividing the horse to swing wide and attack the Shaido flanks, routing them.
Despite his efforts to escape the battlefield and avoid further entanglements with the Shaido, two subsequent engagements both saw Mat victorious; though by the skin of his teeth in Mat's own estimation. In the forth engagement, Mat observed a band of Shaido led by Couladin seeking to sneak through the lines, possibly to assasinate Rand. Mat, left with no choice, engaged Couladin’s force, and personally slew Couladin after being unseated from his horse.
With Couladins death, the Shaido soon withdrew from the battle and retreated across the river Gaelin towards Kinslayer's Dagger.
Towards the end of the battle, which took the entire day and continued into the night, the unaligned clans signaled their willingness to negotiate and joined Rand’s forces not long after.
20,000 Shaido were taken gai'shain during the battle, and thousands more had been killed. The remaining Shaido forces retreated to Kinslayer’s Dagger without significant engagements. There they remained bottled up by Rhuarc and the other Aiel forces until the events of the Battle of Dumai's Wells.
Rand marched into Cairhien and, seeing the Cairhienin treated as second class citizens by the Tairen forces sent there to help them, declared a number of measures to put Cairhienins on an equal footing with Tairens. This earned the approval of the Cairhienin population, and a rare display of emotion by Cairhienin nobles. Rand was also offered the crown of Cairhienin, though he chose not to take it and left it for Elayne to claim.
Due to his battle prowess during the battle, the Cairhienin and Tairen forces led by Mat largely decided to remain with him and formed the core of what would become the Band of the Red Hand.