The Olympics is a place where the best athletes on the planet come together. That's pretty obvious. But there's always that little catch of limiting the number of athletes per country, and there are always those athletes from minor, inconsequential sports nations that clearly have no chance at doing anything but going out meekly in the first round of whatever event they're in and just seem to be there to make up the numbers. And boy, doesn't it seem strange that every single competing nation managed to qualify someone somewhere? You'd think sooner or later one of these countries would fail to qualify anyone. How do the Vanuatus and St. Lucias and Albanias and Mongolias and Equatorial Guineas of the world keep managing to get someone into the Olympics?
Their qualification is the work of the Tripartite Commission.
The Tripartite Commission springs into action after all the events have determined what nations are sending which and how many people to the Olympics. In team events, every one of those spots is accounted for in qualifying. But in individual events, a couple spaces are held open. Sometimes, additional slots become available when someone who has qualified drops out.
Major nations like the United States, China, Russia, Australia, France, Great Britain, and just generally anyone who you'd expect to see on a medal stand once in a while don't need these slots. The Tripartite Commission is concerned with nations that have sent six or fewer athletes to the previous two Olympics (and, one would think, anyone over that average that has somehow not managed to qualify a single person this time around). Those nations are eligible to be allocated slots.
Those nations send applications to the Tripartite Commission nominating their nations' best athletes in the sports that have slots available. There are still minimum qualifying standards for these places, so you can't just send anyone. No more Eddie The Eagles.
Athletics (aka track and field) and swimming are used as essentially last-resort sports. While applying nations can request spots for athletes in those sports normally, if a nation can't get anyone qualified anywhere else and still need to send that one athlete, it's a simple matter to just hold another heat of the 100-meter dash or the 50- or 100-meter freestyle (the absolute last-resort events) and slot in the nation's best runner or swimmer there. They're the simplest sports in execution (just run or swim to the other side of the track as fast as you can), and besides, it's easier than adding an extra name to a bracket, as would be the case in sports like boxing, archery or judo.
For instance, here's the qualification breakdown for athletics. in the men's marathon, the Tripartite Commission selections- noted on the Wikipedia page as 'Universality', a principle the Commission tries to meet- are Zatara Lunga of DR Congo, Mithqal Al-Abbadi of Jordan, Marcel Tschopp of Liechtenstein, Mike Tebulo of Malawi, and Augusto Ramos Soares of Timor-Leste. In the women's marathon, the selections are Triyaningsih of Indonesia, Mamoroallo Tjoka of Lesotho, Ni Lar San of Myanmar, Claudette Musakakindi of Rwanda, and Juventina Napoleao of Timor-Leste. As for the last-resort events, 31 men and 16 women are in the 100 meter dash on the back of the Tripartite Commission. 24 men and 31 women are in the 50-meter freestyle this way, as are 21 men and 16 women (and not the same men and women) in the 100-meter freestyle. Note that several more were projected to need the Tripartite Commission as well, but managed to set an Olympic qualifying time and get in on merit.
Here's a PDF copy of the rules for London.
Once all the applications are in, the Tripartite Commission convenes and makes their selections, in all the events, simultaneously. Their task is to qualify the best athletes they can using the available slots while still making sure every country is able to at least send the one person. In the circumstance that they can't find enough people from qualifying nations to fill the available slots in a particular sport, the Tripartite Commission will simply hand those slots back to the sport to be filled with whoever would have normally qualified next, so if you're paying attention around that time, you will still see major-nation athletes who barely missed the cut in qualification also hoping the Tripartite Commission will call their name- and every so often they do. For the women's boxing competition, making its debut this year, about 30% of the field was filled by the Tripartite Commission, so for them, they just decided to go ahead and take the best available boxers overall, clearing the way for the selection of, among others, American Queen Underwood.
And that's why you're taking multiple pee breaks during the Parade of Nations.
You. Not me.