Most OS X programs have a ''default program'' dropdown list in their preferences. For example, here's what I see in Mail.app:
From where is this list retrieved? How does each application know what other similar applications are available on the same computer?