While the accepted and most upvoted answer is great, I additionally find it useful trying to explain the difference only by words:
merge
- “okay, we got two differently developed states of our repository. Let's merge them together. Two parents, one resulting child.”
rebase
- “Give the changes of the main branch (whatever its name) to my feature branch. Do so by pretending my feature work started later, in fact on the current state of the main branch.”
- “Rewrite the history of my changes to reflect that.” (need to force-push them, because normally versioning is all about not tampering with given history)
- “Likely —if the changes I raked in have little to do with my work— history actually won't change much, if I look at my commits diff by diff (you may also think of ‘patches’).“
summary: When possible, rebase is almost always better. Making re-integration into the main branch easier.
Because? ? your feature work can be presented as one big ‘patch file’ (aka diff) in respect to the main branch, not having to ‘explain’ multiple parents: At least two, coming from one merge, but likely many more, if there were several merges. Unlike merges, multiple rebases do not add up. (another big plus)