How can a zip code have a primary city and county that are in different states?

Sometimes a Zip code can overlap two states. The primary county will be the one with the most area in the zip code.Here is an example with Zip code 82063 that overlaps both Wyoming and Colorado:

The only city it overlaps is Jelm, in Wyoming. That is why the USPS uses Jelm as the zip code's primary city (which is what the field of city means). But, the majority of the area overlaps Larimer County, CO so that is used as the primary county. Here a screenshot to illustrate: