Where do sources such as alexa compete, etc., collect their data to create internet statistics such as the best websites and most visited websites from the list of countries?
These sites collect raw data by tracking the behavior of their users to collect data and performing some statistical fudging to obtain traffic estimates.
In the case of Alexa, it collects Alexa toolbars from user data . Compete does the same, but with a wider and more broadly defined "panel" of users .