Mushrooms are the visible flowering bodies of fungi, one of the major kingdoms in the classification of living organisms. The mushroom is composed of the stem rising from the ground, the cap on top of the stem, and the gills (or lamallae) on the underside of the cap. These lamellae are the papery gills that are responsible for releasing and dispersing the spores that the mushroom produces. These spores are highly protected cells that are the primary means for fungi reproduction.
Most fungi can reproduce both asexually and sexually to maximize their reproductive capabilities. Asexual reproduction occurs via sporangia to produce haploid spores. These spores are dispersed from the mushroom, often using wind for motility. These haploid spores can then produce new fungal bodies if they land in an area suitable for growth. Sexual reproduction occurs via hyphae, or filament structures emanating from spores. If compatible hyphae from two different spores meet, gametagia form at each tip. The haploid gametagia mix to form a diploid zygospore. The zygospore can then undergo meiosis to produce haploid sporangia, which in turn produce more spores asexually and the whole process begins again.
For some reason I am unable to post the image directly, but there are two excellent diagrams found in the second reference link below. Scroll about halfway down to see them.