The standard system in macOS is based on a Uniform Type Indicator, or UTI, like public.plain-text for a plain text file, and public.jpeg for a JPEG image.
To determine the file type, macOS uses MIME types when downloading from the Internet, can still use old Classic Mac OS four-character type codes, and ultimately relies on UTIs.
To get the UTI of a given file, use the mdls (meta data list, part of Spotlight) command in the Terminal.
PDFs have a MIME type of application/pdf per the spec, but you might still encounter some with MIME types like application/x-pdf. MacOS reads the MIME type of a file, then assigns the com.adobe.pdf UTI (if it wasn’t already assigned by another Mac application).