The File extension describes the type of digital file something is and what program is needed to open it, unless it is actually installing a program (see .exe).
A .pdf file extension, for example, will open as a PDF, a .jpg as a type of picture, .docx as a word document file.
The issue is that something can look like a legitimate file extension, e.g. .xls for Microsoft Excel but actually be a malicious .exe file. For example, the visible file when you go to click on it may look like “redundancies.xls”, however the actual file name may be very long such as “redundancies.xls………………..exe” and so the file extension is actually an executable.