The Tourneys provide a chance to knights to display their skills and test them if need be. If a Knight of the Kingsguard is killed in a tourney or disgraces1 himself, well needless to say he's not fit to guard the King, is he? Winning the tourney validates their appointment and reassures the realm of their superiority in feats of arms.
That doesn't mean however that on defeat, Knights of Kingsguard are relieved from their duty. Ser Jaime Lannister was defeated by Loras Tyrell in a tourney, Ser Duncan the Tall (A legendary Lord Commander who's as famous as Ser Ryam Redwyne, Ser Aemon the Dragonknight etc) was defeated by squire Barristan Selmy in the lists etc. Selmy was subsequently knighted by King Aegon V as a reward of his excellent show and eventually rose to White Cloak himself. So as you can see, it also provides young talent a chance to win the white cloaks or make themselves noted by the Crown. How better to prove that you're worthy of a white cloak (once there is an opening) than defeating those wearing the white cloaks?
But of course, their participation in tourneys is subject to Royal assent. Aerys II refused to allow Jaime Lannister ride in the lists at Tourney of Harrenhal and immediately sent him packing to King's Landing on pretext of guarding Queen Rhaella and Prince Viserys. Ser Gerold Hightower, Lord Commander at that time, offered the King that he will go to King's Landing in stead of Ser Jaime so that the young Knight could participate in the tourney but Aerys refused since his sole objective was to humiliate Lord Tywin and assert his right over Jaime's life.
King Aerys made a great show of Jaime's investiture. He said his vows before the king's pavilion, kneeling on the green grass in white armor while half the realm looked on. When Ser Gerold Hightower raised him up and put the white cloak about his shoulders, a roar went up that Jaime still remembered, all these years later. But that very night Aerys had turned sour, declaring that he had no need of seven Kingsguard here at Harrenhal. Jaime was commanded to return to King's Landing to guard the queen and little Prince Viserys, who'd remained behind. Even when the White Bull offered to take that duty himself, so Jaime might compete in Lord Whent's tourney, Aerys had refused. "He'll win no glory here," the king had said. "He's mine now, not Tywin's. He'll serve as I see fit. I am the king. I rule, and he'll obey."
That was the first time that Jaime understood. It was not his skill with sword and lance that had won him his white cloak, nor any feats of valor he'd performed against the Kingswood Brotherhood. Aerys had chosen him to spite his father, to rob Lord Tywin of his heir.
ASOS - Jaime VI
Kingsguards are more than just glorified bodygyards. The Lord Commander sits on the Small council and serves the realm with his wits as well as his sword. Other members serve as proven and skilled commanders for the King's armies. Who can command an army better than seven of the realm's greatest knights, the greatest swords? Whose loyalty could be counted on without any doubts other than the Kingsguards?
Who guards the King?
So who performs the duties of guarding the King when the White Swords are out fighting in Tourneys or leading the King's armies? We do know that White Swords can name other notable fighters in their stead to guard the King whenever they convene to meet in the Whitesword Tower like Jaime's meeting with his brothers following King Joffrey's assassination.
The table itself was old weirwood, pale as bone, carved in the shape of a huge shield supported by three white stallions. By tradition the Lord Commander sat at the top of the shield, and the brothers three to a side, on the rare occasions when all seven were assembled.
Stand by your seat, ser.” Kettleblack complied. The other Sworn Brothers filed in one by one.
“Sers,” Jaime said in a formal tone when all five had assembled, “who guards the king?”
“My brothers Ser Osney and Ser Osfryd,” Ser Osmund replied. “And my brother Ser Garlan,” said the Knight of Flowers.
“Will they keep him safe?”
“They will, my lord.”
“Be seated, then.” The words were ritual. Before the seven could meet in session, the king’s safety must be assured.
ASOS - Jaime VIII
Presumably, something similar occurs when Kingsguards are all away, they name other puissant warriors to perform their duties. But bear in mind, all Seven Kingsguards are rarely away from the King. Even In the Rebellion, the following were the deployments of the Seven:
- Ser Jaime Lannister was ordered to stay behind in the Red Keep on pretext of guarding the King.
- Prince Lewyn Martell was ordered to go south, take command of the Dornish Armies coming from the South and then head North to fight the Rebels.
- Ser Jonothor Darry was ordered to go north and command the Royal forces against the Rebels.
- Ser Barristan Selmy was ordered to go north and command the Royal forces against the Rebels.
- Ser Gerold Hightower, Lord Commander of the King's Guards, accompanied the Prince of Dragonstone, Rhaegar south and was stationed at Tower of Joy on command of the Prince.
- Ser Arthur Dayne accompanied the Prince of Dragonstone, Rhaegar south and was stationed at Tower of Joy on command of the Prince.
- Ser Oswell Whent accompanied the Prince of Dragonstone, Rhaegar south and was stationed at Tower of Joy on command of the Prince.
Similarly in the tourneys, if one KG was riding in the lists, 6 others would be present by the King's side.
1. A defeat after riding a gallant course and honourably proving your skills against a better foe is not disgrace. Losing after a poor display (Like Lord Gawen Swann against Prince Valarr, or Ser Kyle the Cat against Lord Joffrey Caswell), arriving drunk (Like Ser Dontos Hollard), dishonourably targeting the foe's mount or unprotected areas to deliberately hurt them (Like Gregor Clegane against Ser Hugh of the Vale or Prince Aerion against Ser Humfrey Hardyng) is.