I've definitely had those moments where a shot looks perfect on my screen but doesn't land, and yeah, it's almost always a latency thing. Most games use what's called hitscan or projectile-based detection - hitscan instantly checks if a ray from your gun intersects with an enemy's hitbox (usually a simplified shape like a cylinder or capsule), while projectiles are actual objects that travel and check for collisions each frame. The issue is that your client shows you a slightly different enemy position than what the server sees, since your input takes time to reach the server and the server's state takes time coming back to you, so what looked like a headshot on your screen might've been a miss on the authoritative server. Some games try to compensate with client-side prediction or aim assist, but there's always that inherent delay - it's why competitive shooters often feel different on low-ping versus high-ping servers.