It's actually not all that expensive to add electric to the parking area, when it's properly planned. A new circuit would be run from the electric utility mains to a new transformer, which would run to a central charge controller that would in-turn supply power to receptacles or whatever at each parking space. If they have to run individual conduits to each stall or each pair of stalls they will, or they may rely on larger cables and intelligent devices on individual breakers at each spot, with some kind of data communication back to the central charge controller to log the energy drawn.
Obviously this works best where apartments have covered parking since the canopy structure acts as the mounting for the conduit and the whole system is at least partially out of the weather. Most apartments around where I live are like this, with assigned spots to given units.
Is there a security protocol for charging? It would be convenient to just be able to pull-in to one's spot and plug in and have the controller recognize the valid car, so that the person whose spot it is doesn't get billed if someone else parks and attempts to charge there while the rightful tenant is away.