1) If you have sold shares, it takes 2 trading days for the trades to get settled in your Demat account. The money that gets released from this transaction is available to withdraw on (T+2) day only.
2) If you have taken a position in FnO trades, then the increase in your SPAN requirement gets adjusted from the margin available. Your M2M value, even if it is positive for the day, doesn't get added on the same day in the withdrawable balance since M2M settlement for all segments is on (T+1) day.
3) Brokerage charges for the trades placed are adjusted from the available margin
4) Any foreseeable charges such as Annual Maintenance Charges, Exchange Transactions charges, Securities Transactions Tax, SEBI Charges, Stamp Duty, etc are also deducted from the available margin and the same will get billed subsequently in the ledger.