The deferral is a measurement from when the update is released by Microsoft. So two days means 2 days from 1000 PST (typically) on the day the update is released (the 2nd Tuesday of the month typically).
Similarly, the deadline is a measurement from when the deferral expires or when Microsoft releases the update if no deferral is specific.
It's not random, but yes, it is linked to the update detection frequency which is every 22 hours: see https://learn.microsoft.com/en-us/windows-server/administration/windows-server-update-services/deploy/4-configure-group-policy-settings-for-automatic-updates#automatic-updates-detection-frequency.
Thus, the deferral and deadline times for a system must be in the past at the time an update eval takes place.