Refactoring involves restructuring existing code without changing its external behavior in order to improve the code's design, make it easier to understand and modify, and reduce bugs. It should be done in small, frequent changes whenever adding new code or fixing bugs. Refactoring improves code design by removing duplicates, clarifying conditional logic, and specifying all logic in one place. Potential issues include tight coupling to databases and interface changes. Common scenarios for refactoring include duplicate code, long methods, large classes, and long parameter lists.