If a defender commits a foul inside the penalty area that denies the opposing team a goal or an obvious goal-scoring opportunity (DOGSO), the punishment changes depending on whether a challenge was made:
Attempt to play the ball: If the referee decides the defender made an attempt to play the ball, the player receives a yellow card (caution).
No attempt to play the ball: If the defender does not attempt to play the ball (or there was no possibility of doing so), they are sent off (red card).
So is it just a PL/EFL thing or a FIFA rule?