Who decides (and by what criteria) how many people each country can enter in a given sport? Not team sports, but individual competitions.
IIRC each sport has a defined number of people allowed to enter from a given country. For example (making these numbers up), the Olympic Committee says every country can send 3 people for Luge, 3 people for speed skating, etc… Each country is responsible for determining who they would like to send and sets there own rules on who goes.
Note that it is NOT always the same number for each country. They vary it based on things like how popular the sport is in that country, how many of the top players are there, etc.
This is an attempt to ensure that a country like Russia, where there are lots of good ice skaters, can send more of them than say Egypt, where ice skating is not so popular.
The goal is to get most of the best competitors in each sport to the Olympics.
But because of the nationalism aspect, that doesn’t always work out. I remember in the Summer Games, some good (and very young) American swimmers/divers did not make the Olympic team, though their record was better than the Olympic members from some other countries. Had they been from another country, less competitive in swimming/diving than the US, they probably would have gone to the Olympics.
It seems some of it is dictated by qualifying standards like in the Summer Games. I heard someone from our Olympic committee talking today about the speed skating team who are in the B Final for 5th to 8th and he remarked that even if they only finish 8th it is a good result because only 8 countries met the qualifying standard. Who knows what that was.