For example on Keywordspy, you can enter a website and it will tell you what their PPC keywords are, daily ad budget, etc. How are they getting this information?
I can understand how they do it if I give them a keyword: They search on Google and scrape all the PPC ads. But I can't see how they do it given a domain unless they go through massive keyword lists and scrape all advertisers. But even so there's no way their keyword list would have long-tail keywords that contain brand names.
There are dozens of companies offering similar services so I'm guessing it's no major technical feat either, but I just can't see how it's done.