The modern vehicle needs to be locked when not in use. The locking process advises the computers in the vehicle that they are no longer required. In this “sleep” mode the power consumption is at its minimum.
Depending on the vehicle manufacturer, if not locked, a vehicle’s computers will stay in “standby” mode and continue to consume extra power. If left in “standby” mode, most modern vehicles will monitor the electrical system and if over a period of time there is no usage it will shut down devices and enter “sleep” mode.