The date on which any dividend on a stock that has been declared but not distributed belongs legally to the seller, rather than the buyer. That is, when one sells a stock on or after the ex-dividend date, it will go to the seller when the next dividend comes. On the other hand, if it is sold before the ex-dividend date, the dividend will go to the buyer.
The first day of trading when the seller, rather than the buyer, of a stock will be entitled to a recently announced distribution of an asset. The price of the stock can be expected to fall by approximately the value of the distribution on this date since the stock no longer carries the right to the distribution.