The iPhone gets the time from different places. It can get time information from your carrier, and Apple servers over the internet.
A GPS + Cellular may use the same time servers from Apple and your carrier as well, and it will also sync the time from the paired iPhone if the other 2 are not available.
Get help with the date and time on your iPhone, iPad, and iPod touch - Apple Support