What does formatting a CF card do?

Formatting a CF card erases all of the data on a CF card, including files, images and directory structures. Formatting a CF card may also repair a non-functioning card with corrupted data. Physical damage, faults or bad sectors cannot be fixed by formatting.