Coal is formed when peat is altered physically and chemically. First, peat undergoes several changes as a result of bacterial decay, compaction, heat, and time. For the peat to become coal, it must be buried by sediment. Burial compacts the peat and, consequently, much water is squeezed out during the first stages of burial. Continued burial and the addition of heat and time cause the complex hydrocarbon compounds in the peat to break down and alter in a variety of ways.