I am talking for French mostly. I am not sure if this is true for other languages.
First reason is that it was not silent long time ago. They used to pronounce everything, but the spelling is evolving faster than the writing.
Second reason is that the clerks or monks used to copy the books (handwriting before the invention of the printer) they were paid by the length of the writing. Thus adding many silent letters was increasing the amount of money they were making.
Latest Answers