The moves
The setup is ordinary. Black pins the knight on f3 to the queen with ...Bg4, and a pin like that feels absolute. It isn't.
White plays 5.Nxe5!, leaving the queen on d1 to be taken.
Why the pin fails
A bishop pinning a knight to a queen is a relative pin: the knight can legally move, and the only question is whether losing the queen matters. Here it doesn't, because f7 is weak and the knight on c3 is ready to jump to d5. The king has no flight squares after 6.Bxf7+ Ke7, and 7.Nd5 finishes it.
How Black should respond
The mistake is taking the queen. If Black plays 5...dxe5 instead, White recaptures on g4 and comes out a pawn ahead, which is a bad position but a playable game.
Better still, avoid the problem: develop with 4...Nc6 instead of spending a move on ...h6. The knight protects e5, so the sacrifice no longer works in this form.
Other versions
The pattern travels. It works whenever a bishop aims at f7, a knight can take on e5, and a second knight can reach d5. The Three Knights version reaches the same mate a move later.
Common questions
Who was Légal?
François Antoine de Légal (1702-1792) was a leading French player of the Café de la Régence in Paris and the teacher of François-André Danican Philidor.
Does the Légal Trap always work?
No. It relies on Black taking the queen. After 5...dxe5 6.Qxg4 White is only a pawn up, and the mate never happens.