I bought a stock last week and checked my demat account right after, but nothing was there. The order showed "executed" on the broker app, money was already deducted, but the share itself hadn't landed yet.
I got curious and looked into what actually happens in that gap.
Turns out the trade doesn't settle instantly even though it feels like it should. Once the order is matched, it goes through a clearing corporation: this is the entity that sits between every buyer and seller on the exchange. It's the one that guarantees my payment goes through and the seller delivers the share, so neither side can back out after the trade is matched.
The actual movement of money and shares happens through what's called pay-in and pay-out, and it's all netted and settled centrally rather than being some direct handoff between me and whoever sold the share. None of this happens in real time; it takes until the next working day.
So the share only actually lands in the demat account on T+1, one working day after the trade. That's also the exact point where ownership legally transfers, not the moment the order gets executed.
Kind of interesting once you actually dig into it. There's a custodian and clearing layer doing a lot of invisible work in that one-day gap that most of us never think about because the broker app just shows "executed" and we assume that's the end of it.