If you purchase one day before the Ex-dividend date which is called as Ex-cum date and sell it the next date, you are still eligible for the dividend. Since the stock is in Zerodha’s pool account, dividends on that stock get credited to Zerodha’s bank account. When the money gets credited to Zerodha’s bank account, we in turn credit it to the clients trading account with us. An entry similar to below is made on clients ledger with us.
We do this credit of dividend to trading account once a week for all our clients (typically on a Thursday). So if the dividend is passed out on Monday, clients who have pledged their stocks with us might get it only by next Thursday.