Locks are mechanical or electronic devices designed to secure objects, spaces, or information by restricting access to authorized individuals. They function through various mechanisms such as keys, combinations, or biometric data, and are integral to security systems across residential, commercial, and digital environments.