Ah! That is one of my favourite quotes from Mark Twain :)
It's a sarcastic quote (duh!)... It means that if you keep your mouth shut, people can only assume that you are a fool. However, if you start jabbering on nonsense, that'll CONFIRM the fact that you're a fool!
The moral..... Just DON'T talk and learn to keep your mouth shut, okay?