Novels
Stannis is not a point-of-view character in the novels, so his actions are witnessed and interpreted through the eyes of other people, predominantly Davos Seaworth and Jon Snow, and later, Asha and Theon Greyjoy.
When King Robert Baratheon travels to Winterfell to name Eddard Stark as his new Hand of the King, Stannis has already fled to Dragonstone with his forces, including most of the royal navy. Stannis suspects the involvement of Cersei Lannister, the wife of the king, in the sudden death of the previous Hand, Lord Jon Arryn, with whom Stannis had investigated Robert's many bastard children. It is later revealed that the true culprit was Jon's wife, Lysa Tully, who was persuaded to poison her husband by her lover Petyr Baelish.
After assuming the position as the new Hand, Eddard learns of Stannis' and Jon's investigations and conducts his own investigation, discovering that Cersei's children are not Robert's but instead the products of her incestuous affair with her twin brother, Ser Jaime Lannister. After Robert's death from a hunting accident, Eddard tries to change Robert's inheritance from the de jure heir, Crown Prince Joffrey Baratheon, to Stannis, who by proper primogeniture would be Robert's legitimate heir, but he is betrayed by his own daughter Sansa (who still wants to marry Joffrey and thus naively informs Edward's plan to Cersei) and confidant Petyr Baelish (who turned the City Watch against the Starks instead). After losing the political struggle and all his men massacred in the subsequent violent purge by House Lannister, Eddard is imprisoned and later publicly beheaded, despite already agreeing to swear fealty (under the threat of his daughters' lives) to Joffrey as the new king.
Stannis comes under the spiritual influence of the foreign red priestess of R'hllor, Melisandre, who believes that Stannis is the reincarnation of Azor Ahai, a messianic figure in her faith. Stannis declares himself the one true king of Westeros, citing Joffrey's illegitimacy as a bastard of incest, but most of the Baratheon bannermen instead support the claim of his more charismatic younger brother Renly, as does the powerful House Tyrell due to Renly's nominal marriage to Margaery Tyrell. Stannis tries to negotiate with Renly, offering him the chance to become his heir, but Renly laughingly rejects him and plans to use the superior military strength to destroy Stannis' army the next day. However, Renly unexpectedly dies the following evening, assassinated by a shadow demon conjured by Melisandre using Stannis's life force. After his death, many of Renly's bannermen immediately switch allegiance to Stannis, though the Tyrell forces withdraw. One of Renly's personal guards, Brienne of Tarth, goes rogue and swears to avenge his death by assassinating Stannis but is talked out of it by Catelyn Stark.
Melisandre later uses the same shadow magic again to assassinate Ser Cortnay Penrose, the defiant castellan of Storm's End who still refuses to submit to Stannis after Renly's death, making the whole of Stormlands bending the knee to Stannis. Now equipped with the strongest single standing army and navy in Westeros, Stannis attempts to capture the capital city King's Landing with an amphibious assault through Blackwater Bay, but Tyrion Lannister traps and destroys his vanguard fleet with a hidden boom before detonating incendiary wildfire on the Blackwater River. With many of his men killed in the fire attack, Stannis' remaining forces still make landing and begin sieging the city, nearly claiming victory. However, House Tyrell have sided with the Lannisters due to the latter's offer to have Joffrey marry the widowed Margaery, and the Lannister–Tyrell reinforcements arrive just in time to relieve King's Landing, attacking and routing Stannis' exhausted forces from the rear. With the help of Rolland Storm, the Bastard of Nightsong, Stannis manages to flee the battlefield safely, but the defeat at the Blackwater effectively ends his capacity to further challenge the Lannisters' hold on the Iron Throne.
Stannis retreats to Dragonstone with what is left of his army (around 1,500 men-at-arms), but the hired sellsails have all abandoned him. He imprisons his Hand, Lord Alester Florent, one of his wife's uncles, for trying to offer terms of surrender to the Lannisters. Another of Selyse's uncles, Ser Axell Florent, castellan of Dragonstone, aims to become Stannis' new Hand of the King and suggests a plan to attack Claw Isle in retaliation for Lord Celtigar bending the knee to Joffrey. However, Davos Seaworth, who returns after surviving falling overboard at the Blackwater, derides an attack on this defenseless island as evil, and for this honest counsel, Stannis names Davos as his new Hand instead.
Melisandre advises Stannis to burn Edric Storm, one of King Robert's known bastards, as a human sacrifice for blood magic to raise dragons from Dragonstone. Stannis is conflicted about burning his biological nephew but agrees to use Edric's blood collected by leeches to curse the three rival kings: Joffrey Baratheon, Robb Stark and Balon Greyjoy. Later, after the unexpected deaths of Robb (who is murdered at the Red Wedding), Balon (who suspiciously falls of a chain bridge) and Joffrey (who is poisoned at his own royal wedding to Margaery) seem to prove the cursing power of a king's blood, Stannis considers sacrificing Edric. However, Davos foils this plan by hastily smuggling off Edric from Dragonstone to the Free Cities for protection, and then convinces Stannis to instead sail to the Wall and rescue the Night's Watch from the invading wildling army. After Melisandre burns Alester Florent as a sacrifice to R'hllor to ensure favorable winds, Stannis takes most of his remaining army and sailors north to relieve the wildlings' threat on the Wall.
After arriving at Eastwatch-by-the-Sea, Stannis dispatches Davos to go to White Harbor in order to convince other Northern lords to join his cause, before marching west outside the Wall to relieve the wildlings' siege upon Castle Black. The sudden arrival of Stannis' army catches Mance Rayder, the King-Beyond-the-Wall, by surprise, and Stannis' cavalry routs the entire wildling horde with few casualties, taking hundreds of prisoners. Afterwards, Stannis remains at Castle Black to negotiate a settlement over the captured wildlings and offers to legitimize Eddard Stark's bastard son Jon Snow as the new lord of Winterfell if Jon swears loyalty to him and joins the fight against House Bolton. Despite being tempted, Jon declines the offer as he has made an oath binding him to lifelong service in the Night's Watch and does not want Winterfell's godswood to be burned by Melisandre. Later, Stannis pressures the Night's Watch to finish electing a new Lord Commander, and Jon is eventually elected through cunning secret lobbying by Samwell Tarly.
Stannis sends ravens to the Northern houses asking for their support in the name of the legitimate king, but only House Karstark and a small faction of House Umber swear allegiance. Stannis seemingly has Mance Rayder (who, unaware by Stannis, is actually another wildling chieftain named Rattleshirt disguised as Mance by Melisandre's illusion magic) burned at the stake, and most of the wildling prisoners end up bending the knee to Stannis. To rally the Northern houses to his side, Stannis intends to attack House Bolton's ancestral castle, the Dreadfort, with the help of Arnolf Karstark, castellan of Karhold. In reality, Arnolf is working with the Boltons, secretly relaying intelligence and hoping to entrap Stannis, in order to have his great-nephew Harrion Karstark (who is the legitimate heir of Karhold but was captured by House Lannister as a hostage prisoner of war) executed so that his own branch of the family can take control of Karhold. However, Jon Snow wants Stannis to hand over the wildling prisoners to him so he can reinforce the Wall's defense. In exchange, Jon advises Stannis to instead march west and win over the support of mountain clans, who are fiercely loyal to late Eddard Stark, and then attack the Ironborn invaders so that Stannis can rally other Northern lords on the west coast.
Stannis accepts Jon's counsel and marches west, defeating the Ironborn raiders holding Deepwood Motte and taking Asha Greyjoy captive. He restores the castle to House Glover, thus winning their support and that of the nearby House Mormont and the mountain cadet branch of House Flint. With his forces now greatly bolstered, Stannis then marches on Winterfell to confront the Boltons, joined by the men of Arnolf Karstark and Mors Umber (who has also captured the escaped Theon Greyjoy and "Arya Stark" (who in reality is Sansa Stark's childhood companion Jeyne Poole, forced to marry the sadistic Ramsay Bolton in order to give House Bolton fake legitimacy over Winterfell), but his army is waylaid by heavy snows and forced to camp at a small lakeside crofter's village three days' march away from Winterfell.
Some time later, Jon Snow receives a letter allegedly written by Ramsay, claiming that Stannis has been defeated and killed, though it is unknown how much of the letter is true or whether Ramsay even wrote it. George R. R. Martin confirmed to a fan in 2015 that Stannis is still alive in the books.
In December 2011, Martin posted a sample chapter from the yet-unfinished sixth book, The Winds of Winter, told from Theon Greyjoy's viewpoint, wherein Stannis is actively and efficiently preparing for the looming battle against the army of the Bolton–Frey alliance. He secures a war loan from the Iron Bank of Braavos by signing a blood contract with the banker Tycho Nestoris, whose convoy managed to find Stannis'army, and plans to immediately send Tycho back to the Wall for safety. Tycho also relays a message from Jon Snow informing Stannis of Arnolf Karstark's planned treachery, which Jon has learned from Arnold's escaped niece Alys. Stannis then arrests Arnolf, his son Arthor and his three grandsons, and plans to execute them. He also subdued Tybald, the Dreadfort maester who accompanied Arnolf, and Tybald, out of fear, confesses that he has already messaged Stannis' position to the Boltons in Winterfell.
Stannis then sends Ser Justin Massey to escort Tycho and "Arya Stark" back to Castle Black to reunite her with Jon Snow, in gratitude for Jon's counsel of gathering the Northern mountain clans. Massey is to then travel to Braavos and use the Iron Bank loan to hire 20,000 sellswords for Stannis' future campaigns. Stannis tells Massey that, if he is reported dead, even if the news is true, Massey is to follow orders and keep supporting his daughter Shireen's claim on the Iron Throne.
Stannis then interrogates Theon Greyjoy for information regarding the Boltons' military strength. When Theon taunts Stannis for not taking Ramsay seriously enough, Stannis confidently reveals that he already has a battle plan to utilize the terrain against the incoming Frey army. Stannis next receives Asha Greyjoy and informs her that her brother Theon must be executed, as showing him mercy would mean losing all of the Northmen. To spare Theon the agony of death by burning, Asha pleads with Stannis to personally behead him in front of a weirwood tree in the tradition of the Northmen.