Except Wikipedia is a non-profit and the content produced is under a free license. The founder of Wikipedia and the few employees are the least wealthy people to run a top 10 website.
Nobody contributes to Wikipedia or Stackoverflow because of license. Most contribute because humans like sharing information with other people. If Wikipedia's eyeballs are low, people wouldn't contribute.
But people knew that the content is easily accessible over internet and the usage would grow. If the content is only available in say one library in a random city, people wouldn't contribute for free.