The way NAND flash works is by providing a number of "eraseblocks" - each "eraseblock" has a number of "pages." Typically, you are looking at 128 Kbyte eraseblocks divided into 64 2 Kbyte pages. Each page can be written to, changing bits from 1 to 0. If you want to change any bits back from 0 to 1, you have to issue an erase command to the whole eraseblock which resets all bits to 1 (unless the block is worn).
Writing isn't perfect and some bits may fail to change from 1 to 0, or flip by themselves.
There is also an "out of band area", or an extra page, per eraseblock. There, ECC codes can be written, and that is what is used for SLC flash. For MLC flash, they use BCH codes which can recover more bits.
Internally this is how things work. SD cards do not provide raw NAND access but go through an internal microcontroller which is responsible for wear leveling and all that good stuff. The host device never sees the raw NAND, but only a block device. But SD does use ECC or BCH AFAIK.