Time dilation occurs when an object is in motion relative to another object, not when it is at rest. In special relativity, the concept of time dilation arises from the fundamental postulate that the speed of light is constant in all inertial frames of reference. This means that the measured speed of light will always be the same for all observers, regardless of their relative motion.
When two objects are at rest relative to each other, they share the same frame of reference, and there is no relative motion between them. In this case, both objects experience time in the same way, and there is no time dilation effect observed.
However, when one object is in motion relative to the other, their frames of reference are different. Special relativity states that the passage of time is not absolute but is dependent on the observer's frame of reference and their relative motion. As the moving object approaches high velocities relative to the stationary object, time dilation becomes significant.
The reason for time dilation is that the constancy of the speed of light requires the measurements of time and space to be adjusted in different reference frames. The faster an object moves relative to another, the more it experiences a "slowing down" of time from the perspective of the stationary observer. This effect is a consequence of the interplay between space and time in special relativity.
So, to reiterate, time dilation occurs when there is relative motion between two objects. When they are at rest relative to each other, there is no time dilation effect because they share the same frame of reference and experience time in the same way.