It depends on your risk tolerance.
For those who aren’t emotional about investing and have a greater-than-10-year horizon, an investor can stay fully invested to capture the dividend growth. Also, there are only a few dates during the calendar year when the market moves. If you miss the big “up” days, you can seriously mar your performance.
For those who are in retirement or who have a low level of risk tolerance, the most cash you should have at any one time is 20%. If you’re 100% invested in stocks, any cash you hold is known as a “synthetic short” because it’s not invested. It’s sitting on the sidelines. As a result, having 20% in cash leaves your net market exposure at 60% (80% invested in stocks minus 20% cash position). So, if the market falls 10%, you should only drop 6% (and less, depending on the dividend yield of the portfolio).