Why do some softwares have memory leak?
Google and Bing are your friends.

A Memory Leak is due to bad memory management of the application.  Basically, it allocates memory but fails to release it when finished.  Therefore, as the application continues to run, it keeps allocating free memory until there is no more.

The fact that certain browsers use more or less memory has nothing to do with there being a memory leak.  Chrome likes to have individual processes for each tab  or session (more memory) where Firefox does the opposite.  Memory is cheap now so there is less of a need to be efficient, but there is a need for higher performance.

The real issue is what to do about memory leaks - since most people don't reprogram and self-patch a program like FireFox - you can quit a program that has leaks or just log out. Mac OS (as well as most other operating systems) then release all the leaked memory and return it to the system pool. Leaks happen, so as an educated user you can watch for them and tend to leaky programs as opposed to letting them run continually.