The key to answer this question is the idea of endosymbiosis, in particular the work of Lynn Margulis.
Symbiosis is when two organisms live very close to each other in a beneficial way. An even more intimate relationship is Endosymbiosis where a microbe lives extremely close to a host and in fact is engulfed by them but not harmed. Kind of swallowed like being eaten by an amoeba, but not digested. Allowed to go on living within the host and work for the host, providing it with some benefit.
The best known examples are chloroplasts and mitochondria which are ...
Endosymbiosis meant that simple cells formed quorums with increased complexity.