This is also a useful button if you want to remove unassigned materials from an object:
But, they don't immediately disappear from the file unless you save and re-open Ctrl+Shift+O the file.
And, they also don't get removed from the file if there's one or more other objects using them.

