They don't, the host of whoever will choose a certain amount of teams from a list that they want to be in the cup.
Each team that qualified got qualified for the confederations because they are the winners of the the most recent continental tournament/cup:
Egypt won the 2008 CAF Africa Cup of Nations winner
Irap won the AFC Asian Cup 2007 winner
Spain won the UEFA EURO 2008 winner
The US won the 2007 CONCACAF Gold Cup winner
New Zealand is the OFC Nations Cup 2007/08 winner
Brasil won the Copa America in 2007
Italy qualifies automatically because they won the last world cup
South Africa also qualifies automatically because they are the host
I got this all from FIFA.com
..hope it helped
Egypt won the 2008 CAF Africa Cup of Nations winner
Irap won the AFC Asian Cup 2007 winner
Spain won the UEFA EURO 2008 winner
The US won the 2007 CONCACAF Gold Cup winner
New Zealand is the OFC Nations Cup 2007/08 winner
Brasil won the Copa America in 2007
Italy qualifies automatically because they won the last world cup
South Africa also qualifies automatically because they are the host
I got this all from FIFA.com
..hope it helped