A lot of times people will use the same Google Analytics or Adsense code on multiple sites. This lets you find all the sites a particular code is used on.
For each site the last digit increments. We only use the part that stays the same.
However it is fairly easy to get actually unique GA codes under the same account. But many people do not do that.
With AdSense you cannot get a different publisher ID unless you set up a whole new account.