The Megachilidae are known from trace fossils (characteristic leaf cuttings) from the Middle Eocene. The Melittidae are known from Palaeomacropis eocenicus in the Early Eocene. The Colletidae appear as fossils only from the late Oligocene (~25 Mya) to early Miocene. The highly eusocial corbiculate Apidae appeared roughly 87 Mya, and the Allodapini (within the Apidae) around 53 Mya. By the Eocene (~45 mya) there was already considerable diversity among eusocial bee lineages.
A fossil from the early Cretaceous (~100 mya), Melittosphex burmensis, was initially considered "an extinct lineage of pollen-collecting Apoidea sister to the modern bees", but subsequent research has rejected the claim that Melittosphex is a bee, or even a member of the superfamily Apoidea to which bees belong, instead treating the lineage as incertae sedis within the Aculeata. The oldest non-compression bee fossil is found in New Jersey amber, Cretotrigona prisca, a corbiculate bee of Cretaceous age (~65 mya). This same evolutionary scenario may have occurred within the vespoid wasps, where the pollen wasps evolved from predatory ancestors. 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. The ancestors of bees were wasps in the family Crabronidae, which were predators of other insects.
Bees are a monophyletic lineage within the superfamily Apoidea. Bees are insects with wings closely related to wasps and ants, known for their role in pollination and, in the case of the best-known bee species, the western honey bee, for producing honey.