The reasons usually include the detergent, fabric softener, and other products in the wash.
There are several causes for bad odor after washing laundry. The main reason is that too much detergent or fragrance was added to the load of clothes that will result in bad-smelling towels or garments. Another cause is overloading washer with clothing so much so there’s not enough water to cover anything which can’t help but leave behind bacteria placed on clothing by people handling it. Fabric softeners also take part when using too many liquids at once because these formulas prevent soap bubbles from forming which results in poor cleaning ability and residue left behind on fabrics resulting from incomplete rinsing of soapy solution from fabrics during a cycle.
One other reason for bad smell is not drying wet clothes fast enough. Clothes that are left to sit in the washer with detergent and water for too long will start to smell funny after washing. You can try adding some dryer sheets or all natural fabric freshener to your wash load during rinse cycle to help with this problem.