In a nutshell
A parity bit is added so a group's number of 1s stays even; flip one bit and the count goes odd, exposing the error. Done per row and per column (2D parity), a single flip fails one row check and one column check — and where they cross is the bad bit, which can then be corrected.