After that fresno customer buys an iphone and pays the tax to Cupertino, Cupertino gives apple 35% of that tax back effectively lowering their sales tax rate.
Then, the state portion has a fraction that gets allocated to a municipality (thanks to Prop 13, a lot of local funding has been shifted to getting granted from the state), which is generally going to be the municipality where the business is located.
These distinctions generally only come up for online transactions and some high-cost durable goods like automobiles (which is why there’s no benefit to buying your car in a different county—you’ll still pay the same tax).
⸻
1. Thanks to a prop 13 lawsuit, for a time in the 90s, the county tax (or was it city? I don’t remember now) for San Diego was actually -0.5% because it was judged that the county (city?) had illegally raised taxes and this was the method by which the judge determined that the taxes would be rebated.
To the extent that is approximately correct, the issue here is that the Apple/Cupertino deal involves Apple apparently filing false paperwork to make Cupertino rather than the actual distribution site for the particular order the bottom of the stack, and is getting kickbacks from Cupertino out of the money effectively stolen from some other jurisdiction by that false reporting.