In "Sir Gawain and the Green Knight," what does the opening, about nation-building, have to do with the rest of the poem?
If you read the beginning of the preface to Gawain's tale, you will note that the narrator begins his story in the past, laying the ground work of events that transpire before Arthur's time.
Not only does this provide the story with roots, but it makes it seem more plausible as the narrator gives a credible history as to how the world arrives at a place where Arthur and his many adventures take place. By giving a history, it makes the story more plausible.
For example, if a story is written where a magical kingdom appears from nowhere, the reader has a sense he is reading a fairytale. However, if a story is written with a sense of history, the stories are more believable. (Giving the history does not make the Arthurian legends true, per se, but lends a sense of authenticity to the stories).
To add a sense of reality to the tale, the narrator starts with the famous battle of Troy, between the Greeks and Trojans. This famous battle is believed to have actually taken place. Providing information about this widely-accepted occurrence in history also provides a sense of realism. It gives one the feeling that the information to follow is based on fact. The narrator describes the war's aftermath—how the world begins to rebuild after the hostilities that went on for so many years.
The introduction to the story tells of the reconstruction of civilization: including the building of major cities such as Rome, Tuscany, and ultimately Britain. The description of the founding of the kingdom of Britain provides the pathway through the generations that leads up to the birth of Arthur, and, later, his place in history as the greatest of all British Kings. For years, many people believed the stories of Arthur's heroic and honorable feats.
Providing a history of how his country and he came to exist, makes the stories more believable. There are, of course, indications that Arthur did, in fact, exist, but that he lived long before the medieval period, so he would have been dressed in skins rather than armor— but he was still an excellent warrior, highly admired by his people.
Any time we try to make something real, whether a character in a story, or even find the certainty that an event took place, the act of including history of some kind gives credibility to the person or event by looking back to history for its beginnings.