Idea · From the Margen catalogue
A dividend isn't new money: it comes out of your own share

You collect fifty euros in dividends and it feels like money from the sky. It isn't: it comes out of the company itself and therefore out of the very share sitting in your portfolio.
On the day the stock trades without the right to that payout — the ex-dividend date, which the company publishes weeks in advance — the price opens marked down by roughly what it is about to pay. If you held a thousand euros of stock and they pay out 5%, by the afternoon you hold 950 euros of stock and 50 euros in cash. A thousand euros was still a thousand euros.
Except for one thing: the taxman takes his cut on the way. In Spain dividends are taxed as investment income and carry a 19% withholding at the moment you are paid, so of your 50 euros you receive 40.50. And since 2015 there is no cushion left: the exemption on the first 1,500 euros of dividends a year, which existed until then, was scrapped.
The upshot: you have moved 50 euros from one of your pockets to another of your pockets, and the move cost you 9.50.
So before buying a share "for the dividend", find two dates in the investor section of its website: the ex-dividend date and the payment date. If you buy the day before purely to collect it, the only thing you are guaranteed is the withholding.