Well, typically, those folders contain program's user-specific settings. I.e. those settings that are set on a user-by-user basis. For example, in Skype that would be your personal account, notification, audio/video settings etc. Unfortunately, this is often the case that some of the settings get messed up and it is quite hard to figure out what exactly is wrong. In that case it may be advised to just delete the whole folder to bring it back to the initial state.
There are also other typical folders containing you program P settings, such as ~/.P, ~/.config/P, ~/.gnome2/P, ~/.gconf/apps/P etc. It all depends on where a particular program stores its settings. When you remove a corresponding folder all the settings for the program are gone.
Now, I believe, this also answers the question why the programs do not do that by themselves.