I haven't done anything with Linux in a decade, so I hope this question is still relevant. I've always wanted to know how Linux did this, and I just now thought of it again.
In the Windows OS world, files are associated with an application by their extension. For example, foo.txt may be opened with notepad (txt). And foo.xls would be opened with Excel (xls).
With Linux, file names didn't have extensions (do they now?), so how did it know what app to use to open a file? If a file was called foo, and I double-clicked it, it would actually open within the correct application. How?