The commonest stains and smudges on clothing and other fabrics are usually either oil based or protein based. Oil based stains such as grease spots, makeup smears, chocolate, and egg yolk will not come out easily with ordinary soap. A combination of warm water to soften the oil and an enzyme called lipase, which breaks down the structure of oil, will usually be needed to remove the stain.
Protein based stains such as blood, dairy products, mud, or feces are better washed in cold water (heat tends to set protein stains) with an enzyme called protease, which breaks down the structure of proteins.
The enzymes lipase and protease are themselves proteins, and exposure to high heat will cause their structure to change, a process called denaturation, which renders them ineffective. If you use excessively hot water to do the laundry, the enzymes will denature and they will not work, and the heat will make some of the stains on the fabric become permanent as well.