When you set a timer in the smart app, this information is sent to the online service, which activates the timer and sends the instruction to the smart device to perform the desired action. This could be turning the device on or off, or starting a particular function, depending on the parameters set.
So, in short, it is the online services used by the smart app that run the timers and communicate with the smart devices, making the timers work independently of your smartphone's location.
For example: If you set a timer at home to turn on a lamp at 8 p.m. and then go on vacation to a time zone that is two hours later, the lamp will still turn on at 8 p.m. according to your lamp's local time, which will be 10 p.m. in the new time zone. So you don't have to manually adjust the timers when you go on vacation.