Casterly Rock is the ancestral stronghold of House Lannister. It is located on the Western coast of Westeros on a rocky promontory overlooking the Sunset Sea. It overlooks the major city of Lannisport. A major goldmine is located under Casterly Rock. It is one of the most productive in the realm and provides House Lannister with their wealth.
According to tradition, the castle was originally held by the House Casterly, the old Kings of the Rock. They were hoodwinked into giving the Rock to Lann the Clever, a legendary trickster and ancestor of House Lannister, thousands of years ago, during the Age of Heroes.
After the death of the Lord Hand Jon Arryn, Queen Cersei is worried Lord Arryn might have told the truth about the incestuous nature of her children. Her brother and lover Ser Jaime Lannister says that she worries too much, and Cersei retorts that he in turn never worries about anything, such as when they were seven years old and he jumped off the cliffs at Casterly Rock.
In Winterfell, Jaime Lannister learns his brother Tyrion is visiting the Wall before returning to King's Landing, and jokingly asks him if he is taking the black. Tyrion claims that, were he to go celibate, the whores would go begging from Dorne to Casterly Rock, and explains he simply wants to visit the Wall. Later, on the Way to the Wall, Tyrion talks to Jon Snow and explains that, as a dwarf, the only reason he wasn't left to die as a baby was because he wasn't born a peasant but a Lannister of Casterly Rock.
Upon hearing that Catelyn Stark has abducted his brother Tyrion, Jaime attacks Eddard Stark in the streets of King's Landing, killing much of his retinue. Back in Winterfell, Theon Greyjoy is furious and tries to convince Robb Stark to retaliate by marching against Casterly Rock, where Jaime Lannister escaped to after the fight. However, Robb refuses. In the Red Keep, Lord Eddard learns that Ser Gregor Clegane has been scouring the Riverlands. Aware that Clegane only follows Tywin Lannister's orders, he pronounces Clegane a criminal and instructs Grand Maester Pycelle to send a raven to Casterly Rock and inform Tywin Lannister that he must come to King's Landing and answer for Clegane's crimes —if he doesn't depart Casterly Rock and arrive at King's Landing within the fortnight, he will be brinded a traitor.
Tyrion Lannister introduces Tywin to the Hill tribes he recruited as "My Lord Father, Tywin son of Tytos of house Lannister, Lord of Casterly Rock and Warden of the West." Likewise, in King's Landing Tywin is named Hand of the King and described as Lord of Casterly Rock and Warden of the West.
When Jaime Lannister is taken prisoner by Robb Stark in the Battle of the Whispering Wood, the Lannister bannermen hold a strategy meeting and Leo Lefford suggests they can't march on the Starks at once —they must first return to Casterly Rock and raise levies.
Theon Greyjoy tries to convince his father Balon that, if they pledge fealty to Robb Stark and fight for the Starks in the war, the Greyjoys will be given Casterly Rock as a reward once the war is over. Balon refuses, as he claims the Greyjoys are not subject to anyone and take what is theirs.
As a captive of Lady Brienne of Tarth, Ser Jaime insists on knowing his captor's identity, and to encourage her he introduces himself first as "Jaime Lannister of Casterly Rock, son of Tywin." In Harrenhal, Tywin's bannermen discuss whether to march against King Robb or King Stannis, and Tywin notes that Robb is too close to Casterly Rock, but his brother Lord Kevan argues that, since the Greyjoy's attack on Winterfell has divided Stark's forces, Robb won't risk marching on Casterly Rock until he is at full force. In King's Landing, the Hand in functions Tyrion tells Varys, the Master of Whisperers, that he never expected to have any real power —While his brother became the youngest Kingsguard in history and his sister became queen at nineteen, Tyrion was merely put in charge of the drains and cisterns of Casterly Rock.
During the Battle of the Blackwater, the Ladies of the Court are taken into the protection of Maegor's Holdfast, where Cersei tells Sansa Stark, the Lannister's captive and bride to be of King Joffrey, that she never understood why Jaime and she were treated differently —While Jaime was heir to Casterly Rock, she was "sold to some stranger like a horse to be ridden whenever he desired.
After the Battle of the Blackwatter, Queen Cersei interrogates Tyrion about what he intends to tell Tywin, claiming she is worried because he slandered her to their father before: as children in Casterly Rock, Cersei had the guards beat a servant girl and Tyrion told on her. Tyrion asks Tywin to give him Casterly Rock, which is his by right since the day Jaime became a Kingsguard, as the brotherhood cannot inherit. However, Tywin coldly refuses his request, telling him that he would let himself "be consumed by maggots before mocking the family name and making you heir to Casterly Rock", arguing Tyrion would turn it into his whorehouse.
In Riverrun, Brynden Tully chastises his nephew Lord Edmure for talking to King Robb proudly about his blunder at the Stone Mill, yet Edmure argues his actions made Ser Gregor Clegane flee to Casterly Rock.
Thanks to his wife Talisa Stark, King Robb realizes that, while he can't force the Lannisters to meet them in the field and they can't attack them at King's Landing where they are strongest, he can attack them at Casterly Rock.
Lady and Queen-consort-to-be Margaery Tyrell tries to convince Sansa Stark that her arranged marriage to Tyrion Lannister may not be so bad, as he is far from the worst Lannister and their son together would eventually become Lord of Casterly Rock and the North both. Tyrion gifts his lover Shae golden chains of solid gold from the mines outside Lannisport, smithed in Casterly Rock. However, Shae is angry at his betrothal to Sansa Stark, and tries to convince him to go with her across the Narrow Sea. Tyrion refuses, as he is "a Lannister of Casterly Rock."
At Tyrion and Sansa's wedding, Queen Cersei intimidates Lady Margaery by telling them the story behind the famous song of "The Rains of Castamere": Lord Reyne built a castle as grand as Casterly Rock, gave his wife diamonds larger than any Joanna Lannister ever wore and finally he rebelled against Lord Tywin, for which he and his whole House were absolutely slaughtered. Cersei tells Margaery that she remembers seeing the bodies of the Reyne's hanging high above the gates of Casterly Rock.
Robb consults with his mother about his plan to attack Casterly Rock. He explains that if they take Tywin's castle from him, the lords of Westeros will realize he is not invincible. Catelyn says "show them how it feels to lose what they love".
At Daenerys Targaryen's war council on Dragonstone, her Hand Tyrion Lannister proposes that the Unsullied seize Casterly Rock, rather than put pressure on King's Landing, where they will likely be viewed as a foreign force against whom the native Westerosi lords could unite. Daenerys's handmaiden Missandei comes to the chambers of her lover Grey Worm, the commander of the Unsullied, to bid him farewell, indicating that he will lead the attack, which is apparently going to happen soon.
The Unsullied eventually arrive at Casterly Rock and take the fortress by using a tunnel in the sewers which Tyrion created when he was overseeing their creation in the past. However, the Unsullied find the fortress severely undermanned as most of the 10,000 men strong Lannister garrison has left the castle and are headed towards Highgarden. Jaime Lannister later confirms to Olenna Tyrell that they have deliberately left Casterly Rock to fall into Daenerys's hands. He claims the castle was not of much use for them at the moment and is positive that Daenerys will not hold the Rock for long. Jaime Lannister is proven correct when the Unsullied present themselves along with the rest of Daenary's forces at King's Landing for the parley with Queen Cersei Lannister.
Seat of House Lannister, Warden of the West. Legend has it that Lann the Clever tricked the Casterly family into giving up their castle, thus beginning the Lannister bloodline. The fortress guards a region once rife with gold mines, the source of the Lannister's significant wealth.