The Apple Watch Series 3 and later comes with a built-in GPS chip. It uses a combination of GPS readings and arm movement which can be detected with the help of built-in accelerometer and give you an estimate of number of steps and distance walked.
Allowing the movement of the arm on which you are wearing the watch can lead the watch to give more accurate readings.
Apple also recommends you calibrate the watch to obtain better readings. Refer to this Apple Support document, Calibrating your Apple Watch for improved Workout and Activity accuracy to learn more.
A related discussion on Apple Community Forum post, How does apple watch count steps?, sheds some more light on what calibration does to improve the readings:
Calibrating your watch can improve the accuracy of estimations made by Activity app and Workout app. Calibration teaches your Apple Watch how your arm movements relate to your stride lengths at different speeds when you are walking and/or running. It does this - during outdoor walks and/or outdoor runs recorded via the Workout app - by comparing data from the accelerometer with GPS (Location Services) data.