Food spoilage occurs due to microbial activity when microorganisms such as bacteria, molds, and yeasts break down food substances, leading to undesirable changes like off-flavors, odors, and textures. These microbes metabolize food components, producing waste products that contribute to spoilage, and can also cause foodborne illnesses if pathogenic.