Your environment for starters. $EDITOR, $VISUAL, and several BROWSER variables (console, WWW, and unqualified).
The generic commands "sensible-browser", "sensible-editor", and "sensible-pager". These are shell scripts generally invoking what's defined in the environment. Look under /usr/bin.
The /etc/alternatives/ subsystem. man (8) update-alternatives for how to configure. This works by redirecting generic program names (say, 'editor', 'vi', or 'awk') through symlinks in /etc/alternatives/ to the system preferred default.
Depending on the tool, /etc/mailcap may get invoked. There's a user-defineable area at the top of the file.
GNOME, KDE, and XFCE4 each have their standard application associations which are more or (usually) less coordinated. Manage through their respective configuration utilities (gconf-editor, gconftool, gconftool-2 for GNOME, if you want to avoid the GUI configurator, not sure that KDE or XFCE4 have similar tools).
Some apps (OpenOffice.org and Iceweasel come to mind) have their own associations particularly for mail clients.
Yeah, it's a bit of a mess. There were good (or at least middlin') reasons for most of this at the time.