That is essentially what it does: it uses Youtube's own API to formulate the correct URL, using all publicly known data that Google themselves publish so Youtube can function.
One thing many people are not aware of: youtube-dl actually does it's thing for a whole bunch of sites that aren't youtube.
Generally, it pulls down the HTML page for a site, parses it, and uses the results to pull down the video. The extractor for youtube itself is the most complex one, but there are plenty of others.
Last time I checked it had extractors for something like 700 different sites, along with a generic one that works on a bunch of sites. In general, you can just point it at any video page you see online and have a fairly high chance of it doing the right thing.