Ranking is based on several features. To understand why many top universities are located in the USA, according to many rankings, you might want to look at each feature. Examples of features:
- faculty salary: this gives to USA-based universities an advantage over some of the countries where academics are less paid. (e.g. FranceFrance)
- student satisfaction: the American culture tends to be more positive than in some countries.
- research grants: in some countries, academics don't focus on obtaining grants as much as in the USA.
- reputation: the large average size of US universities make them more visible than in many other countries. Also, (taken from O.R. Mapper in the comments), some American universities seem to run professional news outlets on their websites that report about everything noteworthy that happens in the university. In contrast, in some other countries, e.g. Germany, universities' newsfeeds tend to be on a comparably low priority.
- Americans speak English decently well, it helps to get published, give talk in international conferences, create MOOCs, etc.
- endowment: see Why do American universities receive lots of endowments?Why do American universities receive lots of endowments?
- etc.
Then of course there is brain drain. Students with good academic credentials wishing to study abroad are likely to choose the USA, if they have the option.