Suppose I am driving from New York to Alaska; I fill up my car with gas then drive into Ontario. I have now paid New York a gas tax but I'm driving on Ontario roads; Ontario gets paid nothing for this wear and tear.. until I run out of gas inside Ontario. Then Ontario gets their cut. This continues all the way until I reach Alaska. The money isn't distributed perfectly, but it is distributed.
Now imagine I am instead taxed by the mile. If the car is registered in New York, does New York get all the milage tax? Do they give any of that to Ontario when I tell them I was in Ontario? Probably not, and it would require a lot of book keeping for me to keep track of all the places I've been. Does Ontario instead check my milage at the borders and charge me an exit fee? That seems impractical and potentially problematic. Is some sort of vehicle tracking system used to fairly distribute the money wherever I drove? Such mass surveillance is obviously problematic.
I don't know what the answer is, except for imposing a tax anywhere I purchase gas (or electricity.) That's the least bad solution I can think of.