Compression stockings prevent spider veins by applying graduated pressure to the legs, improving blood circulation, supporting vein walls, and decreasing venous pressure, ultimately preventing small blood vessels from pooling and the development of spider veins.