It's not so much the gaps that are the problem as it is the effect that the delay has on growing compensation.
For every gap there's missed yearly/quaterly reviews, there's missed opportunities for promotion, and there's a stall in your compensation growth overall. When you come back to work you typically come back at the wage you left.