The .desktop files tell any OpenDesktop platform how to represent the app in the application menu environment. It works for every desktop environment in Linux except twm, Enlightenment, and OpenLook that I’ve used. By placing them in the /usr/share/applications folder, they appear for all users on the system.
If you want to dig into the OpenDesktop stuff deeper, check out the GNOME pages as they have a better discussion of how things work:
Putting your application in the desktop menus