what the task manager does is kill everything except for the bare OS. then when you go to home, it will rebuffer all your widgets and icons back into the ram, and will reload any background processes that are required to run the widgets.
occasionally when you run an app and close it, it will leave the process running in the background, taking up ram unnecessarily. an example would be something like tap tap revenge, android market, music player, facebook, the crappy polish media player that came with my phone even though i never used it, etc.
normally, unless you have a task killer or task manager app, these apps will remain hogging up ram until you kill it. even if you use the market or music player once and then close it, it may remain running or may have a background process that remains running. what clear memory does is it removes all of these little annoying processes from the memory and just restores the OS back to its bare ram usage again.
this is useful for when you want to play a game or use an app that requires a lot of ram (ie. dungeon defenders) and you dont want it to crash on you when youre making an ingame purchase because you ran out of ram. you can clear your ram of junk first and then run the game, leaving you with more ram available for the game data.
task killers are silly because people often program them to kill apps that are designed to reopen themselves anyway, which puts the app in a reboot loop that drains more battery.
if you want to permanently stop a process from hogging up ram, you'd have to root your phone, run titanium backup and freeze the useless processes.