Mass does not directly create time dilation. Instead, mass curves spacetime, and this curvature of spacetime is responsible for the phenomenon of time dilation.
According to Einstein's theory of general relativity, mass and energy curve the fabric of spacetime around them. This curvature affects the motion of objects, including the passage of time. The presence of mass or energy causes spacetime to become curved or distorted, similar to how a heavy object placed on a stretched fabric would create a depression or curvature.
When an object with mass is present, it warps the surrounding spacetime. As a result, the geometry of spacetime is altered, and the curvature affects the path that other objects, including light and observers, take through spacetime.
Time dilation occurs in the vicinity of massive objects or regions of strong gravitational fields because the curvature of spacetime affects the passage of time. In regions of stronger gravitational fields, the curvature is more significant, and the effect of time dilation becomes more pronounced.
To put it simply, the presence of mass or energy curves spacetime, and this curvature of spacetime influences the behavior of time. Observers in different gravitational fields or near massive objects will experience time dilation due to the varying curvature of spacetime in their respective locations.
It's important to note that time dilation due to mass is a prediction of general relativity, and it has been experimentally confirmed through various observations and measurements, such as the gravitational redshift of light and the precise ticking of atomic clocks in different gravitational fields.