A polyester running shirt can smell after one session and still smell after a wash, while a cotton shirt worn just as hard comes out clean. The difference is in the fibre chemistry.
Sweat itself is nearly odourless
The sweat produced across most of the body is largely water and salt, and it carries almost no smell as it leaves the skin.
Odour appears when skin bacteria break down the heavier secretions from glands concentrated in the underarms and a few other areas, producing volatile compounds.
So the smell in a garment is a record of bacterial activity on residues held in the fabric, not of the sweat itself.
Polyester repels water and attracts oil
Polyester fibres are hydrophobic. Water beads and moves along the surface rather than soaking in, which is exactly what makes the fabric feel dry during exercise.
The same surface chemistry attracts oils. Skin lipids and the compounds dissolved in them bind readily to the fibre and sit there, out of reach of plain water.
Cotton behaves in the opposite way. It absorbs water into the fibre, holds sweat as moisture rather than as a bound oily film, and releases most of it in a normal wash.
The wash cycle does not reach the residue
Detergents lift oils by surrounding them, but that depends on contact time, temperature and agitation. Activewear is usually washed cool and gently to protect elastane.
Fabric softener works against the same goal. It leaves a light coating that traps residues in the fibre and reduces how well the fabric moves moisture afterwards.
The garment leaves the machine looking clean because the visible soil has gone while the bound lipids remain, which is why the smell reappears the moment the shirt warms up.
Construction adds to the problem
Performance fabrics are often knitted with textured yarns and brushed inner faces to move moisture. The extra surface area that speeds drying also gives residue more places to sit.
Seams, elastic bands and printed panels create dense zones where water flows less freely, so those areas hold the strongest smell.
Antimicrobial finishes are sometimes applied to slow bacterial growth, but finishes wear down with repeated laundering and do not remove residue already bound to the fibre.
Why the smell becomes permanent
Each incomplete wash leaves a little more behind. Once the residue layer is established, it holds bacteria between wears and the garment starts to smell before it is even worn.
At that stage the fabric has changed state rather than simply being dirty, and normal washing maintains the situation instead of reversing it.
Garments washed promptly, warm where the label allows and without softener stay usable far longer, because the residue never accumulates enough to take hold.