Because walking is not a great exercise, it consumes very little calories and doesn't even sweat. Running, on the other hand, consumes people's physical strength and makes them sweat. As long as people sweat or sweat more during exercise, it means that they have achieved the function of consuming calories and can lose weight.
Therefore, running 2 kilometers is definitely more calories than walking 4 kilometers, which is more effective in losing weight. (and 2 kilometers is not close, it is 2000 meters away. Generally, people with weak constitution will be tired if they can't run down without breathing for 2 kilometers.