Geolocation data

Hello,

I am quite interested if anybody knows where companies/services such as ip2location and maxmind get their data from?
How would I go about gathering such information about all ips?

ICANN - Wikipedia, the free encyclopedia
Internet Assigned Numbers Authority - Wikipedia, the free encyclopedia

Any information concerning IP addresses would come from those organizations.