Introduction
In the initial question,  Peter G. Chang asks,
"What I don't get is if one object is moving at a speed relative to another object, shouldn't this movement affect the distance between them in the reference frames of both of them, since their movement is merely relative?"
As far as I can tell, as of the time of writing, none of the six answers thus far submitted address this particular aspect of question.
In the figure below I give a standard configuration of reference frames. In both there are two events. One event is the departure of a muon from it time and place of creation. The second is the arrival of the muon to its time and place of colliding with the Earth's surface. There, the left frame is the frame $S$ of the surface of Earth at rest, while the right frame is the frame $S'$ of the muon in in relative motion with respect to Earth. The muon is moving to the left with a speed of magnitude $|-v_{m\mid E}|$.

Yet, as indicated by Peter G. Chang, the motion is relative. So, in the figure below I give the standard configuration of reference frames again. In both there are two events. The events are the same as those described in the anterior paragraph. However, the left frame is the frame $S'$ of the surface of Earth in relative motion with respect to muon at rest, while the right frame is the frame $S$ of the muon at rest. The earth is moving to the right with a speed of magnitude $|v_{m\mid E}|$.

Materials and Methods
Materials
We have two objects moving in relative motion with respect to one another. One if a muon and the other is the earth. The relative speed of the two objects as they approach each other is given as $|v_{m\mid e}|= |-v_{e\mid m}|$.
Method
The method is to construct a Minkowski spacetime diagram for both of the standard configuration of reference frames that I give in the introduction.
Results
In the figure below, I show the Minkowski spacetime diagram for the first figure in the introduction.  Two things are important to note here. First, is that the length that is measured in the frame of the moving muon is contracted with respect to the length that is measured in the frame of the stationary Earth. Second, is that the elapsed time that is measured in the frame of the moving muon is contracted with respect to the elapsed time that is measured in the frame of the stationary Earth. Mathematically speaking,
$$ \Delta{t'} < \Delta{t}\qquad \text{and} \qquad \Delta{z'} < \Delta{z}.$$

In the figure below, I show the Minkowski spacetime diagram for the second figure in the introduction.  Two things are important to note here. First, is that the change in distance that is measured in the frame of the stationary muon is less than the change in distance that is measured in the frame of the moving Earth. Second, is that the elapsed time that is measured in the frame of the stationary muon is less than the elapsed time that is measured in the frame of the moving Earth. Mathematically speaking,
$$ \Delta{t} < \Delta{t'}\qquad \text{and} \qquad \Delta{z} < \Delta{z'}.$$

Discussion
Irrespective of how we portray the relative motion (i.e., the muon moving towards the Earth, or the Earth moving to the muon) the elapsed time between the events is measured by a clock attached to the muon is less that the elapsed time between events as measured by a clock attached to the surface of the Earth at the point of collision. Similarly, the spatial distance between the events in the frame of the muon, is less that the distance between the events in the frame of the earth. Either of the two configurations are equally valid to solving this problem, as are each of the two Minkowski spacetime diagrams given in the results.
However, when we solve a problem in special relativity, we have to be careful to equate variables correctly depending on the exact wording in the problem. For example, in 1 Gray writes that "These muons ... are traveling at relativistic speeds with, on average, a $\gamma$ of 40." This indicates that the problem is being specified from the perspective of the first figure in the introduction.  Further, Gray writes that, "the muons are created at a nominal height of 15 000 m." Thus, refering to the first figure in the results, we are given $\Delta{t}$ and $\Delta{z}$. From which, we have that
$$\Delta{z'} = \frac{\Delta{z}}{\gamma}<\Delta{z} \qquad \text{and}\qquad \Delta{t'} = \frac{\Delta{t}}{\gamma}<\Delta{t}.$$
This said, nothing whatsoever prohibits us from using the second figure in the introduction and the the second figure in the results.  In such case we interpret the problem statement by refering to the
second figure in the results, where we are given $\Delta{t'}$ and $\Delta{z'}$. From which, we have that
$$\Delta{z} = \frac{\Delta{z'}}{\gamma}<\Delta{z'} \qquad \text{and}\qquad \Delta{t} = \frac{\Delta{t'}}{\gamma}<\Delta{t'}.$$
To re-iterate the elapsed time and elapsed distance of the two events from the frame of the muon is less than the corresponding time and distance in the frame of the earth.
In conclusion, given taht that one object is moving at a speed relative to another object, (1) it is true that the relative motion affect the changes in distance measured in each frame; and (2) irrespective of how one frames the matter, it is true that the construction of the Minkowski spacetime diagrams reveals the matter correctly.
Bibliography
1 N. Gray, A Student's Guide to Special Relativity, Cambridge University Press, 2022, p. 55.