It is too simple to say that you pay taxes where you pick it up, or you pay taxes where you register the car. It varies state to state. In California, a non-resident buying a car in CA (CA pick up) must pay CA taxes. Because of this, you will frequently see car dealerships in CA ship the car to NV and have the buyer pick the car up there. Many states will reduce the tax owed in the registration state if you can prove you paid sales tax in the state in which you purchased the vehicle. If the tax that you paid is less than the tax due in your registration state, the registration state (typically your home state) will collect the difference.
Some states (read: not CA) will exempt out of state purchasers and give them a 7/10-day "drive off" permit to legally the drive the car out of the state.
Bottom line: You need to look up the rules for your home state. California is not non-resident friendly.
Edit: Additional info - there are typically clauses that say that a car that is registered/resides in a different state for less than 12 months is not exempt from sales tax in the second registration state. For example, if you try to register your car in a state that has no sales tax for EVs, and then immediately re-register the car in a different state, you will still owe taxes. My guess is the tax would be prorated for the duration it was registered in the other state, up to 12 months. So if you want to register your car in an EV friendly state and keep it there for 12 months you can probably get around sales tax. Keep in mind that almost every state has a rule that any car being garaged and/or used in the state for more than x days (typically 30) must be registered with that state.