The ancestors of bees were
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. Until recently, the oldest non-compression bee fossil had been found in New Jersey
amber, Cretotrigona prisca of
Cretaceous age, a
 A bee fossil from the
early Cretaceous (~100 mya),
Melittosphex burmensis, is considered "an extinct lineage of pollen-collecting Apoidea
sister to the modern bees".
 Derived features of its morphology (
apomorphies) place it clearly within the bees, but it retains two unmodified ancestral traits (
plesiomorphies) of the legs (two mid-tibial spurs, and a slender hind basitarsus), showing its transitional status.
 By the
Eocene (~45 mya) there was already considerable diversity among eusocial bee lineages.
corbiculate Apidae appeared roughly 87 Mya, and the
Allodapini (within the Apidae) around 53 Mya.
Colletidae appear as fossils only from the late
Oligocene (~25 Mya) to early
Melittidae are known from
Palaeomacropis eocenicus in the
Megachilidae are known from trace fossils (characteristic leaf cuttings) from the
Andrenidae are known from the Eocene-Oligocene boundary, around 34 Mya, of the Florissant shale.
Halictidae first appear in the Early Eocene
 with species
 found in
Stenotritidae are known from fossil brood cells of
The earliest animal-pollinated flowers were shallow, cup-shaped blooms
pollinated by insects such as
beetles, so the syndrome of insect pollination was well established before the first appearance of bees. The novelty is that bees are
specialized as pollination agents, with behavioral and physical modifications that specifically enhance pollination, and are the most efficient pollinating insects. In a process of
coevolution, flowers developed floral rewards
 such as
nectar and longer tubes, and bees developed longer tongues to extract the nectar.
 Bees also developed structures known as
scopal hairs and
pollen baskets to collect and carry pollen. The location and type differ among and between groups of bees. Most bees have
scopal hairs located on their hind legs or on the underside of their abdomens, some bees in the family Apidae possess
pollen baskets on their hind legs while very few species lack these entirely and instead collect pollen in their crops.
 This drove the
adaptive radiation of the
angiosperms, and, in turn, the bees themselves.
 Bees have not only coevolved with flowers but it is believed that some bees have coevolved with mites. Some bees provide tufts of hairs called acarinaria that appear to provide lodgings for mites; in return, it is believed that the mites eat fungi that attack pollen, so the relationship in this case may be
This cladogram is based on Debevic et al, 2012, which used molecular phylogeny to demonstrate that the bees (
Anthophila) arose from deep within the Crabronidae, which is therefore
paraphyletic. The placement of the
Heterogynaidae is uncertain.
 The small subfamily
Mellininae was not included in their analysis.
This cladogram of the bee families is based on Hedtke et al., 2013, which places the former families Dasypodaidae and Meganomiidae as subfamilies inside the Melittidae.
 English names, where available, are given in parentheses.