Not a trick. En passant is a rule of pawns in chess just as the rule for 2 square starting advance is. In fact its introduction to the rules came directly from the 2 square advance's introduction.
En passant (from French: in passing) is a move in the board game of
chess. It is a special pawn capture which can occur immediately after
a player moves a pawn two squares forward from its starting position,
and an enemy pawn could have captured it had the same pawn moved only
one square forward. The opponent captures the just-moved pawn as if
taking it "as it passes" through the first square. The resulting
position is the same as if the pawn had moved only one square forward
and the enemy pawn had captured normally.
The en passant capture must be done on the very next turn, or the
right to do so is lost. Such a move is the only occasion in chess in
which a piece captures but does not move to the square of the captured
piece. If an en passant capture is the only legal move available, it
must be made. En passant capture is a common theme in chess
This rule was added in the 15th century when the rule giving pawns the
option of initially moving two squares was introduced. It prevents a
pawn from using the two-square advance to pass an adjacent enemy pawn
without the risk of being captured.
Essentially the rule prevents an opponent's pawn from blowing past your pawn using it's initial 2 square advance. If your opponent moves their pawn 2 squares past the point where your pawn could capture it, then you may move your pawn to capture it anyway. Your movement is the same diagonal attack into the square that the opponent's pawn would have occupied had it advanced only one square.