The Second Battle of Deepwood Motte is a battle during the War of the Five Kings. It sees the liberation of the Northern castle Deepwood Motte from the Ironborn, ending King Balon Greyjoy's invasion of the North.
In response to Robb Stark's campaign to overthrow the Lannisters and establish Northern independence, Balon Greyjoy takes the opportunity to attack the poorly-defended North, and has his daughter, Yara Greyjoy, take thirty ships to attack and take Deepwood Motte. Though the castle is taken, Yara returns to the Iron Islands following the Sack of Winterfell and House Bolton's retaliation against the ironborn, leaving a garrison to hold the castle.
House Glover, with help from the Boltons, eventually attacks and retakes Deepwood Motte from the ironborn, killing them all. Balon and Yara are informed via a raven.
As Deepwood Motte was the last Northern castle held by the ironborn, this effectively marks the end of Balon's occupation of the North, all of his men having been driven out by either House Bolton or the local northern Houses. Though Balon vows to strike back, he is killed shortly afterwards by his own younger brother, Euron Greyjoy.
In the books
In the A Song of Ice and Fire novels, the liberation of Deepwood Motte occurs on-screen and under totally different circumstances. It takes place long after Balon's death, while in the show it happens before.
Unlike mentioned in the show, the Glovers do not take part in the battle, and neither do the Boltons. Perhaps Ramsay intended to liberate Deepwood Motte the way he did at Moat Cailin (as written in a letter Asha receives from him), but Stannis beat him to it.
Following the kingsmoot, Asha Greyjoy returns to Deepwood Motte with Sybelle Glover. Sybelle's children Gawen and Erena are left at Ten Towers because Asha fears they will not survive a second sea voyage. Her military force consists of four longships and nearly 200 ironborn.
Stannis, angry and frustrated that the Mormonts and nearly all the other Northern houses have rejected his summoning, plans his next move. Arnolf Karstark, the castellan of Karhold, is the only one who agrees to support Stannis (but he secretly collaborates with the Boltons). Arnolf treacherously prompts Stannis to attack the Dreadfort. Luckily for Stannis, he consults with Jon Snow first. Jon explains to Stannis that his plan is suicide; instead, he advises Stannis to gain the support of the Northern mountain clans, who are fiercely loyal to House Stark, and to liberate Deepwood Motte. Stannis accepts Jon's advice.
Asha is informed about the fall of Moat Cailin. The taunting letter she received from Ramsay implies bluntly that he intends to do the same with the rest of the ironborn who are still in the North. Asha realizes it is simply a matter of time before the castle is retaken, either by Stannis or Ramsay. She considers her options: go to Torrhen's Square, which is still held by Dagmer; make new life as a trader; settle at Sea Dragon Point; return to the Iron Islands and try to raise the ironborn against their new-crowned king. Suddenly, the alarm is raised.
Five men climb Deepwood's eastern wall in an attempt to open the gate, but they are caught by Asha's guards. The single survivor claims that they were alone, attempting to save Lady Glover, but Asha's brutal interrogation reveals their true purpose: to open a gate for the three or four thousand men coming to take Deepwood Motte.
Asha quickly estimates the situation: since her troops are outnumbered and the castle walls are made of wood, there is no point to stay and fight. She decides to retreat back to her longships, five leagues to the north, under cover of darkness. As Stannis's men attack the north gate with a battering ram, the ironborn escape out the south gate and venture into the wolfswood.
The ironborn march all night, but they are slowed down by the darkness and treacherous ground. The northmen, by comparison, know the wolfswood well and are not hindered in the same way. Asha commands her men to camp till the break of day. Soon the northmen sneak up on the ironborn, slaying their sentries and closing in around them. The ironborn fight back fiercely, killing many of the assailants, but being heavily outnumbered and in unfamiliar territory, they are soon overcome.
During the battle, Stannis receives unexpected (but welcome) assistance from a Mormont force, led by Alysane, Maege's second daughter. He writes Jon about that: "Alysane Mormont, whose men name her the She-Bear, hid fighters inside a gaggle of fishing sloops and took the ironmen unawares where they lay off the strand. Greyjoy’s longships are burned or taken, her crews slain or surrendered." Apparently, despite what Lyanna wrote Stannis earlier, the Mormonts have changed their mind about supporting Stannis.
Nearly all of Asha's troops and ships are destroyed, and she and her nine surviving men are taken prisoners. Among the survivors are Tristifer Botley, Qarl the Maid, Cromm (who dies later of his injuries), Roggon, Grimtongue, Fingers and Rook.
Deepwood Motte is restored to House Glover, but it is a small consolation to Sybelle, since she is separated from her family: her children are still held by the ironborn at Ten Towers; her husband Robett is in the White Harbor; her brother in law Galbart was sent by Robb on a mission prior to the Red Wedding, and his fate is unknown.
The victory grants Stannis credibility in the eyes of the people of the North, and many survivors of the northern houses (among them Houses Cerwyn, Tallhart, Hornwood and half the Umbers) join him in his campaign against the Boltons, increasing his host to about 5,000 soldiers, more than three times it originally was. After Stannis is informed about the wedding of Ramsay and "Arya Stark", he marches to Winterfell.
Asha believes that her defeat has destroyed any hope for her to rule the Iron Islands. The ironborn are not a forgiving people, and she has been defeated twice: once at the kingsmoot by her uncle Euron, and again at Deepwood Motte by Stannis - more than enough to stamp her as unfit to rule in the eyes of the ironborn.
There is one more stronghold still held by the ironborn in the North: Torrhen's Square, which was mentioned as being attacked by the ironborn in Season 2, and in the books was taken by Dagmer. As of the most recent novel, Dagmer still holds Torrhen's Square. Asha offers Stannis to have Dagmer surrender, but Stannis refuses, having no interest in Torrhen's Square. The TV series apparently just condensed this so Torrhen's Square was liberated off-screen, and officially the ironborn have no more presence in the North.
In the novels, the liberation of Deepwood Motte is the one time so far that House Forrester has been mentioned in the main narrative - a minor House who serve as vassals to House Glover, who are the main characters in the tie-in video game Game of Thrones: A Telltale Games Series. After Deepwood Motte is liberated, Lady Sybelle Glover provides Stannis with guides and "hunters sworn to Deepwood with clan names like Forrester and Woods, Branch and Bole." A future "season" of the Telltale video game might tie-in with these off-screen events - though the first "season" of the game was set during Season 4 of the TV series, so these events around Deepwood Motte and the Wolfswood would correspond to a potential third season of the video game.