A file extension is only a name, so the checker looks inside the file as well. It tests for the header each console format defines: the iNES signature on NES, the internal checksum pair on SNES (found with or without a 512-byte copier header), the header checksum on Game Boy, Game Boy Advance and Nintendo DS, the byte-order signature on Nintendo 64, and the system signature on Sega Genesis, Master System and Game Gear.
When a header check passes, the platform is shown as confirmed. If the extension and the header disagree, the header wins and the page says so. Hacked, translated and trimmed ROMs sometimes fail a header check even though they are fine, so the result then falls back to file extension only, labelled as such. Other consoles are identified by extension only.
Large files are read in 4 MB pieces and fed straight into the four checksum calculations, so memory use stays flat whatever the file size; a bigger file only takes longer.