Stock trading and settlement is everything that happens between tapping Buy on a broker's app and the shares arriving in your account. Three things happen in between. The order is matched with a seller, the trade is cleared and guaranteed, and then it is settled: the shares and the money change hands. In India, this whole chain finishes by the next working day. This is called T+1 settlement.
Say you buy 10 shares of a company at ₹1,200 each, from your phone in Indore, at 11:05 a.m. on a Tuesday. The total is ₹12,000.
First, the order is checked. Your stock trading app sends the order to the broker's order management system (OMS). The OMS checks that you have ₹12,000 in your account, and that the order is within the exchange's limits. Then it sends the order to the exchange.
Second, the order is matched. The exchange's matching engine keeps a list of every order to buy and every order to sell. It finds a seller at ₹1,200 within microseconds. That seller may well be a computer. A high-frequency trading firm offers to buy and sell the same share all day, and earns a tiny amount on each trade. Large funds trade in the same list. They use algorithmic trading to split big orders into small ones. Professional traders use a trading platform for institutions. Bonds are mostly traded in a different way, between institutions, through electronic bond trading.
Third, the trade is cleared. This step is part of clearing and settlement. A clearing house steps in between you and the seller. It becomes the buyer for the seller and the seller for you. So if either side fails to pay, the clearing house still completes the trade.
Fourth, on Wednesday, the trade is settled. A depository moves the 10 shares into your demat account, the account that holds your shares in electronic form. Your ₹12,000 goes to the seller's broker.
Fifth, the records are updated. In post-trade processing, your broker emails you a contract note, which lists the trade and its charges. It also checks its own records against the depository's and the bank's. This checking is called reconciliation. Futures and options travel along the same path. India is now testing settlement on the same day.