It happens when the pool server(s) are under a Denial Of Service attack. The larger the pool the more often it happens, because some people are
concerned that Bitcoins will devalue if any pool gains more than 50% of the computing power. Or it can happen if the pool's server(s) are having problems. There is nothing you can do on your client to fix it.
What I do is have a secondary and tertiary pool. So if my primary pool is idle I switch to the next pool. It does mean that you will end up with Bitcoins spread across a few pools, but it also mean that you are mining the whole time.