The settlement of Equities in India have evolved in a big way in the recent years. Not so long ago, shares bought/sold in delivery were physically transferred from the transferor (seller) to the transferee (buyer) through the transfer of the Share certificate. The Share certificate entitled one to an ownership in the company whose shares he/she were buying in. The settlement in such cases would take more than 15 days.
The dematerialization process started in 1996 post which the transfer of shares started happening electronically making it much easier and thereby reducing the transfer time.
In the current scenario, what happens is, when someone sells, the broker of the selling client has to debit shares from the client and move such shares to his pool account from where the Exchange swipes shares and gives it to the buying broker who in-turn transfers it to buying client. The process of identifying the client who has sold shares, debiting it, moving it to the pool account takes time and hence the T+2 settlement.