When a trader purchases a call option and there is an upcoming dividend, it can potentially yield a risk-free profit to the owner of the long call if the corresponding put costs less than the upcoming dividend amount. For example, let's say you are the owner of a $100-strike call and the upcoming dividend is $1/share ($100 total) and the corresponding 100-strike put cost $0.25 ($25 total). Well, the owner of the call can turn this into a risk-free profit by exercising the call before the ex-dividend date and simultaneously purchase the corresponding put, resulting in a $75 profit ($100 dividend payment - $25 cost of the put).
ITM vs. OTM calls
Dividend risk can affect all options strategies that have a short call component. That includes long or short call spreads, iron condors, calendars, diagonals, strangles, straddles, etc. especially when the corresponding put of the short call is lower than the dividend amount. That said, ITM calls generally have a higher potential of dividend risk than OTM calls.