Deadlock occurs when job A holds lock 1 and waits for lock 2 while B holds lock 2 and waits for lock 1. Neither can advance without the other releasing its lock.
A consistent lock acquisition order prevents this cycle. A timeout can reveal the stall but does not by itself restore a consistent state.
When to use
Check for it when code or transactions acquire multiple locks.