There’s not really a “how” here. It just is the case.
One way to understand it is that (general) relativity is based on two ideas:
* The speed of light is always constant: everyone in the Universe observes light to be traveling at a constant speed everywhere in the Universe.
* Gravity warps space, changing the lengths of lines.
Since the speed of light is a constant, and the speed of light is (the distance light travels) / (the time it takes for light to travel that far), a change in distance must also imply a change in time. So if gravity warps space to change the lengths of lines, it must also warp time and change the lengths of durations.
Latest Answers