Evolution favors efficiency. Since living things compete for living space, food, and mates, efficient organisms that are better competitors are more likely to leave successful offspring. The division of labor leads to efficiency in living things as it does in society, and therefore, different cell types in multicellular organisms evolved.
Since multicellularity is so adaptive, plants, animals and fungi each developed it independently. Multicellular members of each kingdom competed more successfully by breeding offspring with special protective, digestive, or neural cells.
Evolution of multicellular life
There are different theories about how multicellular life evolved. Symbiosis, sharing of resources as in lichens, may have led to fusion, according to one theory. The syncytal theory suggests that cells developed multiple nuclei, and then partitioned off each nucleus with membranes into separate cells
The colonial theory, though, is the one most biologists favor. They point to actual colonies of single celled organisms as proof of the concept. Eudoria live in colonies of up to 128 cells. They, and many other colonial species, are proof that unicellular organisms prospered by grouping together. These are still not multicellular organisms, because there is no differentiation of function among the colonists, no division of labor. Each cell behaves exactly as the one next to it does.
Volvox is an alga that lives in a hollow spherical colony in water. It has cells that are asexual, and also cells that divide and reproduce, just as animals have. Once a daughter colony has been created, it matures inside the hollow Volvox sphere, which then breaks open to (in effect) give birth to it.
To a biologist, a multicellular organism has cells with different functions, that all share the same genetic material. Therefore, a mere group of cells that are all the same is not multicellular.
Choanoflagellates may have been the first step in the evolution of many-celled animals with different types of cells. Unicellular, they live in underwater colonies. They cling to rock and use their whip-like flagellum to draw in prey in a water vortex. Their colonies are not a single organism though, because there is no specialization, it is every cell for itself.
Sponges are metazoans, multicellular animals. They reproduce sexually. If certain pieces of sponge are broken off though, each can recombine and live on. This is because a sponge has no organs, no liver or heart to be destroyed.
In addition, many of the cells of the sponge, while differentiated, are flexible. They can change roles and positions. A sponge does not have tissues as other animals do. One kind of sponge cell is essentially a choanoflagellate.
Ediacarans were possibly the first animals. Not much is known about them. Scientists believe some ediacarans formed a sort of loose bag around water and algae, and lived off the food that they absorbed from the sea, with the help of the symbiotic alga. They came in other forms as well.
They mostly disappeared at the beginning of the Cambrian era. Perhaps predators got these sluggish creatures. Perhaps they were out-competed. Perhaps there was a universal catastrophe.
The Cambrian explosion
About 530 million years ago, the diversity of animal life seems to have exploded. Like a child who slowly learns to read proficiently, and then suddenly acquires access to all knowledge, life began to take numberless forms, or so it seems. Charles Darwin himself worried about it, thinking the sudden explosion could be seen as an argument against the subtle shaping of life through generations that his theory described.
Of course, the Cambrian explosion took many lifetimes, but it was short in geologic time. There are many explanations offered for the Cambrian explosion, including, for one, that it is an illusion. There were more species before the explosion than we are aware of, some scientists say, and so the increase is not as great as it seems.
Another possible explanation, though, is that the spread of multicellular organisms had enabled each new species to compete more fiercely, and thus frantically increased the arms race among competing organisms, requiring each to compete, to specialize, or to die away.
Multicellular organisms are able to protect themselves better against predators. They compete more successfully for living space. They are more efficient, and in general better adapted. Therefore, evolution produced more, and more varied multicellular organisms with more specialized cells.
Evolution of different cell types allowed kelp to anchor itself to the ocean floor, land animals to grow protective shells, plants to grow roots, and primates to grow brains.