In those repositories that support it, locking allows a user to temporarily lock nodes in order to prevent other users from changing them.
This function is typically used to serialize access to a node in order to forestall the “lost update problem”. Though a compliant content repository will already prevents this kind of inadvertent overwriting of repository content through the InvalidItemStateException, the use of locking can prevent the exception from occurring in the first place.