I'm not sure which hack Tweetbot is using to do this (I think search as noted below), but you can tell it's a hack because it only works for recent-ish tweets. If you go to a tweet a couple weeks old and view details, you can see that it won't fill in the replies.
The way clients usually do this is by fetching all mentions to the user after a given timestamp (of the original tweet), and collecting only those that are replies to the tweet. Since there's a limit on how many mentions you can get, you might not get all the replies.
You have to use the search feature to look for tweets and then look at the parent tweet ID. This is what bots like threadreaderapp, etc do. You can construct it from the bottom up if you know the ID of the last tweet in the thread of responses too, but you wouldn't know that a priori unless the user gives it to your software somehow.
My crusty old version of Tweetbot has been doing that for years...? Maybe not perfectly for tweets with hundreds of replies, but well enough.