AMBER IS a portal to the past. The pieces often capture insects and other tiny organisms in stained-glass mausoleums, providing vivid glimpses of flora and fauna that lived more than 100 million years ago. Each reveals subtle clues about how life on Earth evolved—and where it might be headed. “Because it preserves with such intricacy, you can make detailed comparisons with living species,” says entomologist David Grimaldi, who curates the incredibly diverse amber collection at the American Museum of Natural History in New York City. “There’s nothing like it.”

Trees create these time capsules when injuries trigger a rush of wound-sealing resin. The compound seeps slowly over bark, enveloping buggy bystanders in an effective glue trap. Most specimens form near lakes and rivers, where moist ground or water protects them as they congeal. Over many millennia, layers of sand and clay bury and fossilize them, forever capturing one small moment in history.

Earwig fossilized in orange amber
Earwig in amber. Jarren Vink

Most Cretaceous earwigs were strong enough to escape the sticky snare of tropical conifers, making these specimens an unusual discovery. Imprints like this confirm that descendants of the ancient scavengers haven’t changed much over millions of years.

Orange amber mixed with resin
Resin-coated amber. Jarren Vink

This jagged jewel from Lebanon is approximately 120 million years old, and fossils from this region contain some of the oldest insect records available, Grimaldi says. The rough chunk is quite brittle, so his team coated it with synthetic resin to fill in its myriad cracks.

Pale yellow copal amber with fossilized insects
Insects in copal amber. Jarren Vink

At 500 years old, this specimen from Colombia is young amber, or a copal. The resin oozed from a flowering tree called Hymenaea courbaril found throughout the tropics of the Western Hemisphere. Though relatively new, copals can highlight subtle environmental changes or ecosystem shifts over recent centuries.

Leafhopper fossilized in pale yellow amber
Leafhopper in amber. Jarren Vink

Amber has a way of illuminating critter behaviors, both ordinary and unusual. A pair of mating leafhoppers were caught in the act by a resin flow that created this piece of Dominican amber 17 million years ago.

Dark brown resin with bits of bark closeup
Hymenaea tree bark in resin. Jarrren Vink

As resin trickles toward the ground, it often collects bark fragments and other debris. Microscopic examination of this prehistoric Dominican sample reveals that the structure of the wood within matches that of modern Hymenaea trees.

Centipede in yellow amber
Centipede in amber. Jarren Vink

This centipede met its doom on an extinct Hymenaea tree in Mexico some 17 million years ago. Miners digging in the mountains of Chiapas often find such stones, which vary in color from yellow to deep red, among veins of lignite and clay.

Flower fossilized in orange amber
Hymenaea protera flower in amber. Jarren Vink

Paleontologists and botanists identify the tree that produced an amber by comparing chemical compounds in the sample to those of modern species. In the rare instances that the specimen includes plant remains like this glazed flower, believed to be from Hymenaea protera, the results are easier to confirm.

Been fossilized in orange amber
Proplebeia bees in amber. Jarren Vink

The concentric rivulets in this chunk of Dominican amber formed when one flow ran over another containing some unsuspecting Proplebeia bees. Workplace casualties are an occupational hazard for these creatures, which harvest the gummy secretion to build nests.

Ants fossilized in pale yellow amber closeup
Gerontoformica ants in amber. Jarren Vink

The rich diversity of flora and fauna in Burmese amber has revealed a lot about the early evolution of social insects. Take, for example, this pair of worker ants from the extinct genus Gerontoformica. Closely related species have even been caught fighting one another.

This story originally appeared in the Messy issue of Popular Science. Read more PopSci+ stories.