Magnitude is just the distance from the origin point (0, 0, 0). So the Z axis plays a part of the calculation of the magnitude, but it is not the magnitude.
For instance, if you had a Vector3 value of (20, 0, 0), the Z axis is 0, but the Magnitude is 20, which so happens to map directly to the X axis since no other axes have a value.
A Vector3 of (20, 30, 10) will have a magnitude of about 37.4, which is calculated as:
= sqrt( 20^2 + 30^2 + 10^2 )
= sqrt( 400 + 900 + 100 )
= sqrt ( 1400 )
= 37.41657
And as you can see, the result has no direct equality with the Z axis.
If your confusion is about what the Z axis represents: The Z axis typically represents the depth in 3D space (at least on Roblox). To visualize this, look down at your mouse. Move it left and right. You’re moving it on the X axis. Now move it forward and back. That moves it on the Z axis. Now lift it up and put it down. You’re moving it on the Y axis.