This prevents hardware attacks where a USB device disguises as a keyboard and types malicious commands by locking the screen before enabling any human interface device once connected.