A depository is the institution that keeps the official electronic record of who owns which shares, bonds and fund units, and moves them from one owner to another when a trade settles. India has two depositories: NSDL and CDSL. Your shares are held in your name in one of them, in a demat account. Until the late 1990s, Indian investors held paper share certificates, which could be lost, damaged or forged.
You do not deal with the depository directly. You open your demat account through a depository participant, usually your broker or your bank. Your stock trading app shows the shares in this account. The record itself sits with the depository.
The depository's main job comes on settlement day. After a trade, the clearing house tells the depository which shares must move from which account to which account. The depository debits the seller's demat account and credits the buyer's. In India, this happens on the next working day, under T+1 settlement.
Consider an investor in Patna who sells 50 shares on her trading app on a Monday. Before the shares can leave her account, she must authorise the debit with a PIN and an OTP from the depository. This check stops anyone else from moving her shares. The depository blocks the 50 shares in her account in favour of the clearing house, so she cannot sell them twice. On Tuesday, the depository moves them out of her account and credits them to the buyer's demat account. Her own account now shows 50 fewer shares, and the depository sends her an SMS confirming the change.
The depository also keeps track of who owned which shares on a particular date. Companies need this list to pay dividends and to send voting papers for their meetings. That vote is handled through proxy voting.
A depository is part of clearing and settlement, but it is not the clearing house. The clearing house guarantees that the trade will be paid. The depository records who owns the shares afterwards. In America, one organisation does both jobs for almost all shares. In future, a blockchain could hold the same kind of ownership record, in the form of tokens.