How does the metasploit counter download function work?

meterpreter> download / path / to / file and the job will be done in seconds. How does it work technically from the windows command-line perspective? I'm curious because we can not get a metering session every time, and manually downloading files is sometimes painful.