This feature protects you from locking the key in the vehicle when the key is in the ignition and a front door is open.
If the driver's side power door lock switch is pressed when the driver's door is open and the key is in the ignition, all of the doors will lock and then the driver's door will unlock.
If the passenger's side power door lock switch is pressed when the front passenger's door is open and the key is in the ignition, all of the doors will lock and then the front passenger's door will unlock.