Athletes who are now playing for other countries

Why some Olympians can compete for countries they are not from? US, Russia, and Canada are the countries with the most nationals competing for other countries, while South Korea, Canada, and Germany have the most non-native athletes competing for them.