Coal is a sedimentary rock that is formed from compacted plant matter, such as leaves, stems, and roots. Over millions of years, this plant matter is subjected to high pressure and temperature, causing it to transform into coal. The different types of coal, such as anthracite, bituminous, and lignite, are determined by the degree of metamorphism that has occurred. Coal is primarily found in underground coal deposits called coal beds, which can range from thin layers to thick seams. These coal beds are often found in sedimentary basins and are formed as a result of the accumulation and burial of plant debris in swamps and other wetlands over geological time.