I know I can use the same code on more than 1 site, but if I do this will it target each ad individually or will it combine both sites' content and throw up some unrelated ads?
Adsense is context sensitive ads. Same code on different pages / sites will show ads related to the content on the page on which it is displayed. You can obviously use the same code on whatever place you need. If you want to do tracking the performance of ads on different sites/pages, you can better create different "channels". But the same block of codes will not do any harm.
every page will show differenet ads but suppose if ur 2 sites has same niche like one is about mobile stuff and another is sms or ringtones then it can show same ads at both sites, but usually adsense target ad according to ur keyword, heading tags, content