information:filtering, information:highlighting
Evolution

The immediate ancestors of bees were stinging wasps in the family Crabronidae, which were predators of other insects. The switch from insect prey to pollen may have resulted from the consumption of prey insects which were flower visitors and were partially covered with pollen when they were fed to the wasp larvae. This same evolutionary scenario may have occurred within the vespoid wasps, where the pollen wasps evolved from predatory ancestors.

Based on phylogenetic analysis, bees are thought to have originated during the Early Cretaceous (about 124 million years ago) on the supercontinent of West Gondwana, just prior to its breakup into South America and Africa. The supercontinent is thought to have been a largely xeric environment at this time; modern bee diversity hotspots are also in xeric and seasonal temperate environments, suggesting strong niche conservatism among bees ever since their origins.

Genomic analysis indicates that despite only appearing much later in the fossil record, all modern bee families had already diverged from one another by the end of the Cretaceous. The Melittidae, Apidae, and Megachilidae had already evolved on the supercontinent prior to its fragmentation. Further divergences were facilitated by West Gondwana's breakup around 100 million years ago, leading to a deep Africa-South America split within both the Apidae and Megachilidae, the isolation of the Melittidae in Africa, and the origins of the Colletidae, Andrenidae and Halictidae in South America. The rapid radiation of the South American bee families is thought to have followed the concurrent radiation of flowering plants in the same region. Later in the Cretaceous (80 million years ago), colletid bees colonized Australia from South America (with an offshoot lineage evolving into the Stenotritidae), and by the end of the Cretaceous, South American bees had also colonized North America. The North American fossil taxon Cretotrigona belongs to a group that is no longer found in North America, suggesting that many bee lineages went extinct during the Cretaceous-Paleogene extinction event.

Following the K-Pg extinction, surviving bee lineages continued to spread into the Northern Hemisphere, colonizing Europe from Africa by the Paleocene, and then spreading east to Asia. This was facilitated by the warming climate around the same time, allowing bees to move to higher latitudes following the spread of tropical and subtropical habitats. By the Eocene (~45 mya) there was already considerable diversity among eusocial bee lineages. A second extinction event among bees is thought to have occurred due to rapid climatic cooling around the Eocene-Oligocene boundary, leading to the extinction of some bee lineages such as the tribe Melikertini. Over the Paleogene and Neogene, different bee lineages continued to spread all over the world, and the shifting habitats and connectedness of continents led to the isolation and evolution of many new bee tribes.