RAM is used in many different ways. You see a slowdown when too many things are trying to stay in the foreground. Foreground apps will try to close background processes and sleeping tasks (basically anything that's not a required service) if they need more memory.
If I write an app like Instagram --
I can code the processes and threads in different ways with different priorities. The correct way would be to have the threads and processes needed to run the app in the foreground while the user has it open and looking, and when the user no longer has my app on the screen a main thread goes to sleep, a thread runs as a service to accept push notifications or check for updates, and the rest of the threads are "ghosted" -- marked as dead, not running, and OK to kill when more space is needed. The service (that checks for updates or push messages) would be very small and only used to wake up other processes when updates are received, the main app would be asleep (ok to close if it has to be closed), and the other misc threads are dead, and ready to be killed. There's no need to flush them unless they are needed, because there's a chance the next app that gets opened is my app.
Now if I did it the wrong way, my misc threads and routines would just get backgrounded, and the system will think they should stay alive if at all possible. Or I could bundle everything up in the service that runs always. Or if I really wanted to foul things up, I could code the main app to stay awake even if not displayed to the user. Don't laugh -- apps like that are out there.
TouchWiz 4 is a great real-world example. Prior versions of TW were pretty roughly coded in relation to proper memory management. But when TW 4 came out on the SGSII, people were amazed at how well it worked. Word is HTC has done the same thing with Sense 4. As developers get better at coding for Android (both big guns like Samsung and HTC, and small independent devs) apps will get better and better at managing their memory space.
For now, the only way to fix the issue is to root and edit the minfree settings, or go a step further and edit the kernel minfree settings before building , or just not use apps that cause your phone to crawl. Flushing the RAM is just a temporary fix, because the next time you use an app that behaves poorly it's going to do the same thing again.
One last thing to consider -- next time things get slow, check the CPU speed. Many (as in many, many) times we blame RAM when the CPU is pegged and the system is CPU bound. An that's a whole other mess.