My first walkman was a WM-22, not that much smaller than the first model. My last was a WM-150, which was just a few mm larger than the actual tape in each direction. It felt amazingly elegant. (Took me a while to find out the model numbers by looking at image searches... Sony always had the worst product "names".)
Today electronics can be made smaller, thinner and so on, but this was a complex, intrinsically mechanical device. That's the amazing part. That player is like a well-made watch.
It was probably an off-shoot of their camcorder miniaturization efforts. Those got incredibly tiny considering they had to act like a VCR, helical head and all.
The sad thing is that as soon as Sony perfected the cassette player the CD was the popular medium and they had to do it all over again. When they perfected that MP3 showed up.
It's like how they made a perfect CRT and then flat panels hit hard.