The only thing the IOC does is set the total number of athletes that can compete in a given sport, it is up to each of the international sports federations to determine the process of qualifying and allocating slots to nations. In most cases it involves athletes either recording a standard time qualification time, as is the case in athletics and swimming, or based on current world rankings, or the results of pre-olympic qualification tournaments. These procedures actually limit the number of athletes top nations can send in order to make slots available of other countries.
Nations with very large teams, like the US, Great Britain, China, Australia, Russia and Germany usually share these characteristics:
1) The have qualifying in a broad range of sports
2) They qualify for team sports and events
3) They qualify alot of women athletes
BTW - Saudi Arabia is sending 19 athletes to London, What is noteworthy is that for the first time, 2 of them are women.