The name says one thing, the contents another
Your computer decides which program opens a file from the end of its name (the extension). If the extension is missing, wrong, or one your computer does not know, nothing happens or the wrong program complains. The contents tell the truth: almost every format starts with a few bytes that identify it. A PDF starts with “%PDF”, a ZIP with “PK”, an Outlook data file with “!BDN”.
That is what this page reads. We look at the first 64 KB of the file (and, for ZIP and Office files, the list of files inside) and compare them with the formats we know. When the name and the contents disagree, we say so.