Refactoring is necessary. Especially on, though not limited to, large or complex projects developed over an extended period of time (say, more than 4 months). To understand refactoring, you must understand a few core concepts about software development:
It is a collaborative endeavor involving many technical roles (developers, testers, designers, database architects) and multiple business roles (the users, the project managers, client stakeholders, product managers, etc). A software project does not come from a single “pen” but from multiple authors, all writing the same book.