The cellular slime mold spends most of its life in the form of single amoebas that live on the soil surface and in the forest floor, feeding on bacteria and multiplying by division. But if food dries up, tens of thousands of amoebas gather in a multicellular aggregate called pseudoplasmodium.
Pseudoplasmodium crawls for some time, striving for light (phototropism), and then forms a "fruiting body" on the stem. The stem itself consumes a fifth of all cells, which then die. But the remaining 80% turn into spores and scatter from a height around the district, getting a chance to get to a more abundant place and continue the race. This explains phototropism: it is better for spores to scatter from an open and even elevated, and therefore well-lit place.