First some terminology, most computer have two clocks, the "system clock" is implemented in the OS based on the processor's internal timers, this clock has high precision but only ticks while the system is running. The "hardware clock" or "rtc" is a seperate low power clock with a battery used to keep time when the system is not running.
The pi, in common with many cheap SBCs has a system clock, but does not have a hardware clock. So time ticks normally while the kernel is running, but cannot be tracked while the system is turned off. A script called "fake-hwclock" saves the time to a file on shutdown and on a hourly cron timer, then reloads it on boot. This keeps the time moving in the right direction (which is important for several reasons) but it obviously means that the time on the pi will become more and more out of step with real time.