I've never developed for iOS, but on my iPhone when I go to okcupid.com it somehow 'redirects' to the okcupid app on my phone. So it seems there is some capability for this built in that website developers can take advantage of.
(I'm not sure how they're detecting whether that hook is registered or not, though.)