That's not universal. The City of Vancouver for example has a party system, though the parties are largely not affiliated with provincial or federal parties. There are exceptions there as well though - the Vancouver Greens are affiliated with both the provincial and federal Green parties.
Specifically, I think a political party happens when two politicians make a bargain that they will each vote for some of the other politician's policies. They don't have to call it "the X party" for it to be a de facto political party.
There are some offices which are designated as nonpartisan here in the US too, I think they are typically offices which don't have a lot of scope for this sort of bargaining. If they did have scope for such bargaining, I wouldn't want to rely on the honor system in the long term. I would want to codify it into law somehow. But how? The best way is probably to reduce the incentive for striking bargains somehow? Again, how? Or maybe bargains are just a distraction, and the real problem lies elsewhere? As I said, people should be thinking more.
Some cities have non-partisan mayoral elections. For example, Miami does this under Home Rule charter.
Still, it's often clear who's who. For example, Emilio González prominently displayed a POTUS lapel pin during a debate and bragged about being able to interface with Trump and DeSantis.
https://cityjournal.substack.com/p/big-city-progressives-kee...