Their is no arbitrage opportunity with "buying dividends." YourYou're buying a taxable event. This is a largely missunderstoodmisunderstood topic. The stock always drops by the amount if the dividend on the ex date. The stock opens that day trading "ex" (excluding) the dividend. It then pays out later based in the shareholders on record.
There is a lot of talk about price movement and value here. That can happen but it's from trading not from the dividend per se. Yes sometimes you do see a stock pop the day prior to ex date because people are buying the Stockstock for the dividend but the trading aspect of a stock is determined by supply and demand from people trading the stock.
The dividends are paid out from the owners equity section of the balance sheet. This is a return of equity to shareholders. The idea is to give owners of the company some of their investment back (from when they bought the stock) without having the owners sell the shares of the company. After all if it's a good company you want to keep holding it so it will appreciate. Another similar way to think of it is like a bonds interest payment.
People sometimes forget when trading that these are actual companies meant to be invested in. Your buying an ownership in the company with your cash.
It really makes no difference to buy the dividend or not, all other things constant. Though market activity can add or lose value from trading as normal.