Coal forms from the tissues of plants with the major contributor being the woody tissues, cellulose and lignin, from trees growing in fresh-water wetlands. Land plants first evolved during the early Devonian and by the end of the period had adapted to most terrestrial environments. Beginning in early Pennsylvanian time, vast portions of the eastern portion of Laurentia were covered with coal-forming swamps and bogs, environments that were to be repeated throughout the remainder of the Paleozoic Era and again in the Jurassic, Cretaceous and Tertiary Periods. It was during these times that the combination of climatic conditions and wetland environments developed that were conducive to the growth and preservation of large volumes of wood-rich plant remains in the form of coal-forming peats, largely as a result of tectonic events that placed the continents into the proper climatic zones while at the same time producing the topographic settings under which vast peat-forming environments could be maintained for long periods of time. Some coals, such as those of the western United States, formed from peat that accumulated in land-locked basins created by the extensional tectonics that affected the region in the Mesozoic time while others such as our eastern coals formed in areas of low topographic relief along the margins of continents where they were near to but, as we will see later, were not chemically influenced by the marine waters.
Renton, John J. and Repine, Thomas, "Coal Geology: The Origin of Coal" (2016). Readings and Notes. 4.