The Network Time Protocol (NTP) allows the IP hosts to sinc the time of day settings with a common source clock. This allows for routers and other network devices using NTP to timestamp network events in logging which allows for better troubleshooting of problems that can be correlated to a specific time of day.
Most routers and switches use NTP client mode, these devices can also be configured as NTP servers. NTP defines the messages that flow between client and server and the algorithms used to adjust its clock.
NTP servers usually reference other NTP servers to obtain more accurate clock source defined by the stratum level of the ultimate source clock.
Stratum Level 0 (most reliable) include GPS and atomic clocks, the stratum level gets higher (less reliable) the more devices NTP must sync time with, illustrated in the image below: