A Song of Ice and Fire began life as a trilogy, and has since expanded to six books. As J. R. R. Tolkien once said, the tale grew in the telling.
The setting for the books is the great continent of Westeros, in a world both like and unlike our own, where the seasons last for years and sometimes decades. Standing hard against the sunset sea at the western edge of the known world, Westeros stretches from the red sands of Dorne in the south to the icy mountains and frozen fields of the north, where snow falls even during the long summers.
The children of the forest were the first known inhabitants of Westeros, during the Dawn of Days: a race small of stature who made their homes in the greenwood, and carved strange faces in the bone-white weirwood trees. Then came the First Men, who crossed a land bridge from the larger continent to the east with their bronze swords and horses, and warred against the children for centuries before finally making peace with the older race and adopting their nameless, ancient gods. The Compact marked the beginning of the Age of Heroes, when the First Men and the children shared Westeros, and a hundred petty kingdoms rose and fell.
Other invaders came in turn. The Andals crossed the narrow sea in ships, and with iron and fire they swept across the kingdoms of the First Men, and drove the children from their forests, putting many of the weirwoods to the ax. They brought their own faith, worshiping a god with seven aspects whose symbol was a seven-pointed star. Only in the far north did the First Men, led by the Starks of Winterfell, throw back the newcomers. Elsewhere the Andals triumphed, and raised kingdoms of their own. The children of the forest dwindled and disappeared, while the First Men intermarried with their conquerors.
The Rhoynar arrived some thousands of years after the Andals, and came not as invaders but as refugees, crossing the seas in ten thousand ships to escape the growing might of the Freehold of Valyria. The lords freeholder of Valyria ruled the greater part of the known world; they were sorcerers, great in lore, and alone of all the races of man they had learned to breed dragons and bend them to their will. Four hundred years before the opening of A Song of Ice and Fire, however, the Doom descended on Valyria, destroying the city in a single night. Thereafter the great Valyrian empire disintegrated into dissension, barbarism, and war.
Westeros, across the narrow sea, was spared the worst of the chaos that followed. By that time only seven kingdoms remained where once there had been hundreds-but they would not stand for much longer. A scion of lost Valyria named Aegon Targaryen landed at the mouth of the Blackwater with a small army, his two sisters (who were also his wives), and three great dragons. Riding on dragonback, Aegon and his sisters won battle after battle, and subdued six of the seven Westerosi kingdoms by fire, sword, and treaty. The conqueror collected the melted, twisted blades of his fallen foes, and used them to make a monstrous, towering barbed seat: the Iron Throne, from which he ruled henceforth as Aegon, the First of His Name, King of the Andals and the Rhoynar and the First Men, and Lord of the Seven Kingdoms.
The dynasty founded by Aegon and his sisters endured for most of three hundred years. Another Targaryen king, Daeron the Second, later brought Dorne into the realm, uniting all of Westeros under a single ruler. He did so by marriage, not conquest, for the last of the dragons had died half a century before. The Hedge Knight, published in the first Legends, takes place in the last days of Good King Daeron's reign, about a hundred years before the opening of the first of the Ice and Fire novels, with the realm at peace and the Targaryen dynasty at its height. It tells the story of the first meeting between Dunk, a hedge knight's squire, and Egg, a boy who is rather more than he seems, and of the great tourney at Ashford Meadow. The Sworn Sword, the tale that follows, picks up their story a year or so later.