How did the usage of silent letters came into being? For example : what is the use of 'k' in knife or 'p' in pneumonia ?
First, you have to understand that English spelling was not designed for modern English. It was designed for Middle English, a very different language, with very different sounds.
The designers were the first English printers; Caxton started in 1476, in the middle of the Great Vowel Shift marking the end of Middle English and the beginning of Modern English. Then printing standardized spelling; before, everybody speld funettikli, in there oon fasyun. Rather like handwriting still is today.
As far as "silent" letters are concerned, they remain where they were put, for whatever reason, but the sounds have changed in the words while the spelling has not. Sometimes (like the P in pneumonia) it never was pronounced at all, but was just borrowed with the foreign (in this case Greek) spelling of the root. Others, like the K in knife and the G in singer (which doesn't rhyme with finger because finger does have a G), used to be pronounced in older Englishes, but aren't any more.
English speakers don't like English spelling any more than you do. It's awful and takes a lot of time out of education. But we're stuck with it; too much installed base.