Definition
n“Refactoring (noun): a change made to the internal structure of software to make it easier to understand and cheaper to modify without changing its observable behavior.” n“Refactor (verb): to restructure software by applying a series of refactorings without changing its observable behavior.”
Here are definitions of refactoring, both the noun and verb form.

Basically you are satisfied with what the program does, but not how it goes about doing it.  You set about to change it internally, but not so that any external behavior is modified.