For shares held in demat form, the issuing company declares dividends. The depository participant only holds the shares in demat form, while NSDL is the depository infrastructure and SEBI is the regulator. The dividend comes from the issuer regardless of holding form.