
A charging plug needs to stay seated while it carries current. Some cars or connectors have a latch or powered lock to stop it from moving. The lock can work with the charging controls so the main power contacts stay together while the car and charger stop the current.
Why does it matter when the contacts separate?
Pulling electrical contacts apart under load can make an arc. Charging equipment uses signals and switches to control when current starts and stops. The lock or latch helps keep the physical connection in the right state during that process.
Is the lock always doing the same job?
Some cars can also lock a cable to discourage someone from taking it or unplugging a parked car. When the lock releases depends on the connector, car, and charger, and on whether the session has ended.
For more on how cars and chargers coordinate power delivery, see Electric Vehicle Fundamentals.