Team Fortress 2's hit detection mainly work's like this. The hitboxe's generally work fine i'f the client is either stationary or has a reliable internet connection with no latency issue's. The problem mainly appear's i'f the client has latency issue's because the hitboxe's may not be entirely synched properly with the actual player model. The larger the latency spike, the more further apart you may notice the hitboxe's position to be. So for example, i'f you're moving forward's, the hitboxe's will be behind the player and i'f you're moving backward's the hitboxe's will be further infront of the player model.