I think mouser gave a good description of refactoring. However, as an example, think of a function that does a ton of things: get the data from a website, loops over the characters, tries to extract content, perform calculations, etc. Think of a monster that's multiple screenfuls in length.
Such functions can pretty much always be rewritten to be more understandable. How? By splitting it up into smaller pieces that take care of those other pieces. As a bonus, if you need said functionality in the future, you won't be tempted to copy paste, but can use a simple function-call to the same effect... except any bugs only need to be fixed in a single location. So rather than multiple screenfuls, you'll end up with several smaller functions that (as a general idea) fit on a single screen, easily understandable. And the big monster you had before that suddenly fits on a single screen too (again, as a general idea) with all the different tasks explaining themselves (content = GetWebpage(), number = SearchContentForNumber(content), number += 5)...
Of course, that is a bit too simplified, but that is what it in my experience comes down to.
And regarding 'excellent refactoring' in IDEs... it more-so comes down to for example selecting a few paragraphs of code, and immediately putting it in another function with proper parameters, or other often-used tasks to improve code health.