Two processes waiting to update the rows of a table, which are locked by other processes then deadlock arises. In a database environment, this will often happen because of not issuing the proper row lock commands. Poor design of front-end applications may cause this situation and the performance of the server will reduce drastically.
These locks will be released automatically when a rollback or commit operation performed or any one of these processes being killed externally.
For example, Transaction A might hold a lock on some rows in the Accounts table and needs to update some rows in the Orders table to finish.