Well, if anyone works in radio they can give you a better answer, but here goes my best shot:
The Billboard Top 100 Albums is based off of soundscan. That's partly why most albums have the barcode. The information from each store is sent straight to Billboard (or CMJ for indie album) and complied giving you the top 100 albums of that week.
I believe that the singles are based off of current FM radio airplay and single sales. The more they are in the rotation on Top 40 radio, the higher they are on the chart. It also takes into account all the playlists from radio.
Don't call me on any of this, but I'm pretty sure that's how it works.