When patching is usually enough
Nail pops, hairline seam cracks, doorknob holes and small dings are cosmetic. A proper patch, feathered compound and matched texture will disappear once the wall is repainted.
Settlement cracks that reappear in the same spot are worth a closer look, but the repair itself is still typically a patch.
When replacement makes more sense
Water damage is the big one. Drywall that has been soaked loses strength and can hold moisture behind the surface, so sections usually come out rather than get patched.
Widespread cracking, sagging ceilings and panels damaged across a large area are also better handled by replacing the affected sheets.
Fix the cause first
If moisture caused the damage, the leak has to be resolved before new drywall goes up. Otherwise the repair fails and you pay for the same work twice.
