A formation is a very useful concept in geology. They were originally defined as rock strata (layers) created by the "same formative processes." Formations are recognizable rock layers that might have a uniform history, texture, composition, or thickness. Many formations vary in one or more of these attributes. They are usually named after a "type locality", either the first place they are recognized or somewhere that the formation is outcropping extensively. Any type of rock can be part of a formation: sedimentary, igneous, or metamorphic.

Different environments produce different types of sediment, which are grouped by geologists into different formations. Because many different types of environments and climates coexist on the surface of the Earth at a given time, formations are geographically restricted. As a result, different formations can represent sediments of equivalent ages, but no single formation can extend over the entire surface of the Earth. The boundary between one formation and another might be sharp and well defined, or it might be more gradual. As sediment layers get deposited and stacked atop the previous one, incorporating the remains of animals and plants soon to become fossils, time is recorded from bottom to top, older to younger. Some formations are only several meters thick, while some are several hundreds, and the time they represent can be highly variable. One particularly interesting formation is the Hell Creek Formation, which crops out in North Dakota and Montana and represent stacks of sediments such as sandstone, mudstone, shale, and coal, deposited in terrestrial coastal environments. It formed during the last million year of the Cretaceous period and represents a window in the past that helps geologists and paleontologists to reconstruct the ecosystems in which the very last non-avian dinosaurs lived, up to their demise at the Cretaceous-Tertiary boundary and mass extinction event, 66 million years ago. There are several other terrestrial fossil-bearing formations of the same age outcropping nearby, such as the Lance Formation of Wyoming.

The Lance Formation formed during the same time period as the Hell Creek Formation, but on the opposite side of a shallow inland sea that covered North America, the Western Interior Seaway. Because these formations are close in time and space, they also have comparable sediments and their fossil content reveal comparable ecosystems. Fish, frogs, turtles, salamanders, crocodiles, champsosaurs, and pterosaur fossils have all been found in the Lance Formation. Early mammals have been identified too, and of course, dinosaurs. Dinosaurs of the Lance Formation include: Tyrannosaurus rex, Triceratops, Edmontosaurus, Ankylosaurus, Pachycephalosaurus, and Troodon. The climate was subtropical, warm and wet.

During the last five million years of the Cretaceous, the Western Interior Seaway slowly retreated, which led to a transition of different environment. Geologists have thus recognized different formations representing this transition from the bottom up, starting by the Pierre Shale Formation, representing homogeneous grey shales deposited in shallow marine settings, the Fox Hills Formation, representing shales and sands from near-shore to coastal lagoon and beaches, and the Hell Creek Formation, which is fully terrestrial, represented by floodplains, forested soils, lakes and rivers. Both the Pierre Shale and Fox Hills formations produce fossils such as sharks, rays, marine reptiles, ammonites, brachiopods, and other shellfish, witness of a diverse and thriving marine ecosystem.

Above the Hell Creek Formation, the Fort Union Formation is characterized by colorful banded layers of sandstone, mudstone and coal, which were deposited within a wet and swampy forested environment with lakes and rivers. The Fort Union Formation is very thick and contains important economic deposits of coal, coalbed methane and uranium. The transition between the Hell Creek and the Fort Union formations closely coincide in time with the Cretaceous-Tertiary boundary mass extinction. As such, ecosystems of the Fort Union Formation are drastically different from those of the Hell Creek: fossils of non-avian dinosaurs are gone, and many other species of animal and plants disappeared altogether, yielding fossil assemblages of very low diversity compared to what was known from the Hell Creek. The Fort Union Formation is particularly interesting as it records the history of the post-catastrophe recovery of fauna and flora after the Cretaceous-Tertiary mass extinction event.