Basically there is a server somewhere on the interwebz that the game
knows how to find (via IP address or whatever). When the game loads, it
connects to that server and tells it the game's current version
information, the server responds with whether or not a new update is
available and whatever other info is needed. After that the game display
that an update is available and downloads the update from that server.
That is the basic idea anyway, without getting too technical.
To put it in a possibly better perspective, think about how you manually
update things. First you open your web browser, then you navigate to a URL
that you know. Once the page is open you can see their latest download
version and check if your version is up to date, if it isn't then you click
the link to download it and then update it.
Now think of yourself as the
game and the webpage as the
server. The same concept applies.