In chess, en passant (in passing in French) is a special move for pawns to capture. First, if the pawn moves two squares from their starting square and stands next to an opponent pawn, the opponent's pawn can take the pawn one square diagonally in front of the pawn away from their square.
a
b
c
d
e
f
g
h
8
8
7
7
6
6
5
5
4
4
3
3
2
2
1
1
a
b
c
d
e
f
g
h
En passant move (If the white pawn lands on X the black pawn will be captured)
The en passant rule was invented to prevent pawns being stuck with the opponent's pawn on the same file. If there is no en passant rule, the game will be slower leading to blocking pieces and etc.[1]
Invention
Long ago, pawns could only move one square at a time. Between the 13th and 16th centuries, the two-square move was added to make games faster.[2] The en passant rule may have been added around the same time. The Spanish chess master Ruy López wrote about it in the 1500s.[3]
This rule was one of the last big changes to European chess.[4] In some places, like Italy, the rule wasn’t used at first. Italy adopted it in 1880 to follow international chess rules before the 1881 Milan tournament.[5]: 124–125
About en passant
It is also not a bug, a glitch, a hack or an illegal move, it is actually a real move, because it is a special move for pawns to capture.[6]
Examples
If the white pawn moves two squares from their starting square and stands next to a black pawn, the black pawn can capture the white pawn one square diagonally away from their square in front of the white pawn by using en passant. Or, if the black pawn moves two squares from their starting square and stands next to a white pawn, the white pawn can capture the black pawn one square diagonally from their square in front of the black pawn by using en passant like the black pawn.
Rules of en passant
It has to be a pawn that moves two squares forward from their starting square and it stands next to an opponent pawn and the opponent pawn will capture it.[7]