Cars with keyless entry cannot be locked while the engine's running. Those who left it on probably didn't bother to lock up when they got off. Driver's fault.
If the wireless transmitter doesn't work for some reason (dead battery for example), there's a detachable physical metal key to unlock the passenger door. To start the car, there's a slot where the fob can be inserted. The car detects the key in the slot and it's good to go.