yeah it's basically a discrepancy between where the server thinks you are and where your client thinks you are.
you may notice when everything freezes you can still move, this is because movement is done on the client side with updates to your location pushed asynchronously to the server. this has some unfortunate consequences (such as being able to move in front of an enemy who aggros but who's model hasn't loaded yet, or in this case the server thinking you are where you were a second or two ago)
if you want a good gauge of your latency go mining, compare the time between when you hit the button to mine and when he begins to swing(note SE: a ping timer would be nice) in on JP servers but i'm in america so there is a noticeable lag between those events as it has to negotiate with the server on each swing to keep cheating to a minimum.

--edit--
also, the things people above have mentioned (get out as soon as you see red) is a good workaround but that's all it is, a workaround.