Summary: Usually the stock price at that time has already priced-in the dividend amount. Then will drop after that. It's called dividend selling. It makes no difference to your return. :)
Maybe this article will give you the best insights into what is happening. There is a useful video by Alvin from DrWealth as well who explains this well.
1) Cum Dividend:
- Is the status of a stock when the company is preparing to pay out dividend in the near future. So basically, a dividend is declared, but is not paid.
- The 'cum dividend' status is like a notice to investors. The company would be announcing the amount of dividend that will be paid out soon.
2) Ex Dividend:
- Is the status of a stock when the company has confirmed the list of shareholders to receive the dividend. It is the classification of trading shares when a declared dividend belongs to the seller rather than the buyer.
- Once the company has finalized their list and declared the XD status, the list of shareholders entitled to the dividends will be 'locked in' and no further changes can be made.
- So ex dividend would be the reverse of cum dividend. Which means, if you buy a stock during this date or XD period, you would be excluded from receiving the dividend.