First, you're responsible for knowing where you live. Historically, people who lived in more challenging areas geographically often did not have regular postal addresses at all. You would just have a box number in the nearest town or a rural route stop number, and these obviously didn't reflect the legalities of where you lived. In our modern world, USPS has adopted a policy of 100% physical addressing, meaning that all properties now have a "real" address even if the number part is scaled from mileposts (as is the case in rural areas). Still, I think people who live in areas where any of this is less than obvious understand the nuance that how USPS handles addresses is not necessarily the same as how the voter registration clerk handles them.
Still, it is rarely a problem in practice, because anyone relying on addresses to establish these legal details will have to look at where the address is actually located---not just the city written in it. Keep in mind that quite a few people live in ZIPs where they could write multiple city names in their address.
When it comes to the unusual case of spanning states, it might help to note that the City State Database the postal service uses to validate addresses does not actually differentiate between city and state. "NEW YORK NY" is a single string. The state is really just part of the city name. The fact that USPS implemented it this way indicates the extent to which it does not matter in operational reality.
A sibling comment points this out, but it might also help to explain that in the US, it is very common for people to have mailing addresses in cities they do not actually live in. That's because of suburbs. City lines are often surprisingly arbitrary and reflect complex political histories. Many people consider themselves to live in [major city] but, in legal actuality, live in [unincorporated county that contains major city]. Many of the upsides of living in the city, sans some of the property taxes and voting in city elections! Yet another reason that people understand that mailing addresses are not definitive reflections of political boundaries.
If you ever work as an election clerk you will find this a LOT---people indignant that they cannot vote for the mayor, to whom you will have to explain, somehow for the first time, that they do not actually live in city limits. This tends to be more obvious if you get a property tax bill but a lot of people are renters and never really think about that aspect.