Original: If made of suitable material, some undergarments can serve as nightwear or swimsuits.
Simplified: They keep outer clothes from being made dirty by sweat.