From the video "Hitscan vs. Projectile Weapons: What's the Difference?". A simplified 2D model seen from above (no gravity and no network delay).
What it does: the "line gun" calculates, at the moment you fire, where the line from the muzzle in the aimed direction crosses the target's circle and the wall's rectangle, and counts the nearest one as the hit (0 frames).
The "bullet gun" moves the bullet by "bullet speed × 1 frame" every frame. The point check tests whether the bullet's point is inside the circle or rectangle. The segment check tests whether the line joining the previous frame and the current frame crosses the circle or rectangle.
"Lead the target" estimates the frames needed to reach the target as distance ÷ distance per frame, predicts that the target keeps moving in its current direction at the same speed, and aims at the point target speed × frames ahead (the estimate is redone twice; it does not know about turning back, so it misses if the target changes direction on the way).
The target moves up and down. The aim is the target's position at the moment you press "Fire" (or the point ahead, if leading is on).
AI was used to make the diagrams and code. No game footage is used. Sources are in the video description.