The file command knows nothing about mime types. It identifies a file using tests in the following order: filesystem tests, magic number tests, and language tests. The first test that succeeds causes the file type to be printed. The filesystem test identifies sockets, named pipes, etc. The magic number test, uses the magic file to check for data in a fixed format, such as fixes formats, such as compiled code. If the file does not match the magic number test, it is checked if it is a text file, using different character sets, eg UTF-8. etc. It has been that way since I worked on Unix systems back in the late 1980s, long before mime types, which originate in RFC 2046 from 1996.