What is refactoring?
Refactoring is about changing code, over time, to make it better.
Is that it?
Well, basically yes. The complexity is when there are few tests for a system, its very risky to do this, so generally people haven't. When you have good (automated) tests for the functionality of your system, its possible to refactor with ease, as, should anything break, the Continuous Integration server will immediately alert that something unanticipated has happened.