In the gate, slivers of film, called ‘hairs,’ can get chipped off the edge and stuck in the gate, and there’s absolutely no way to edit it out in post-production - so the shot is ruined. An assistant - called a focus puller in the UK, or first assistant camera in the US - is assigned to check the gate before each shooting session to ensure the gate is clear, and oftentimes after shooting, too. If they see anything there, they then call out “Hair in the gate!”, calling everything to a halt while they clear the ‘hair’ with orangewood sticks - favoured for their oily softness, so they won’t scratch anything - and canned air. Once the gate is cleared, they then call “Gate clear!” and filming can proceed. In this image from a 16mm video shot in 1959, you can see a particularly nasty clump of ‘hair’:
The black mess at top right is the hair, and since there’s a lot of it, it looks like the gate’s been neglected for a while.
Since digital cameras have grown in popularity, the phrase is still sometimes used, although it now refers to checking the memory card to ensure that there were no errors in writing the footage to storage. It’s also still used in a metaphorical sense to mean any small error that ruins hours of work.