There is a location associated with your IP address; there is no cracking involved. You can look up the information associated with your own IP address at
http://www.geobytes.com/IpLocator.htm?GetLocation or any number of similar sites.
There's no way to hide your IP address or the information associated with it, although you could connect through some sort of proxy, and the ads would be targeted to the physical location of that proxy. The proxy itself would need to know your real IP address.
In actuality, it doesn't convey anything dangerous; they can't see your home address or name or anything like that. Even the location is fairly inaccurate. When I lived in a small town, I was always getting ads targeted to the major city 200 miles away because that's where my IP address resolved to. Similarly, all AOL traffic shows up as being somewhere in Virginia, although there are obviously AOL users all over the country. If you don't want to see targeted ads (or any ads for that matter), you can run Firefox with Ad-Block or Ad-Block Plus.
Hope this helps.