This was taken from Alexa's website directly:
Alexa gets its traffic data, including reach, page views and rank information, from a global panel of web users. The panel is used as a statistical sample of Internet usage to extrapolate overall traffic patterns and web usage information. The panel consists of Alexa Toolbar users and other sources web usage information. Details about Alexa’s traffic data can be found on Alexa.com.