Android device screens are rectangles. Rectangles have two sides, one shorter than the other. Let’s call the short one A and the long one B.
-swNNNdp indicates “use these resources if A is greater than or equal to NNN dp in length”
-wNNNdp indicates “use these resources if the width of the device, as presently held, is greater than or equal to NNN dp“
When the user rotates the device between portrait and landscape, the width will change (to be A or B), but A (the shortest width) is always the same.