I'm pretty sure iOS has the website issue a request to open X app w/an argument, so in this case it's Twitter making a request to open their app if installed.
This does have some security implications, so there is a mechanism for web sites to vouch for an app.