This really depends on the franchise, licensing and ownership in that area.
In Germany, I rented a car in Frankfurt and returned it to Munich, no extra cost (national owner, national registration).
In Calgary, I can rent a car at the airport and return it at any city location, no extra cost (same franchise).
If I rent a car in Calgary and return it to Edmonton, I pay a one-way fee as someone has to drive the car back (different franchise, same registration). They might get lucky and have a one-way renter drive it back.
If I rent a car in Calgary and return it in Toronto, the agent in Calgary simply sells the car to the Toronto location. It's cheaper than returning it. (Different franchise, regional registration. Ontario franchises cannot rent an Alberta-registered vehicle.)
I asked the counter staff why I have two keys on a steel-cable (non-separable) ring, the second key is clearly not a spare. One-way sales happen often enough that they want all the car's hardware to travel with it.