Why encoding matters
A file, a web page, and a keyboard all carry text as bytes. The encoding says which bytes mean which code point. Two tools that disagree about the encoding turn the same bytes into different text, which is the cause of the garbled characters you sometimes see.