Wood pops or crackles suddenly in a fire when the wood contains excess moisture that becomes heated from the fire and evaporates. When this water becomes heated, it expands and becomes a pressurized gas, eventually forcing itself out of the wood and resulting in a popping or crackling sound.
While moisture in the wood is typically the main culprit behind popping and crackling in a fire, there are other possibilities as well. For example, holes in the wood, caused by insects or damage to the tree, can also cause pressurized gas to be suddenly released when the wood is heated. Tree sap, as well as other materials that may have accidentally gotten mixed up with the wood pile, can also cause popping to occur.
Using seasoned wood that has been allowed to sit and dry over a long period of time is the best way to prevent popping. Popping in a fire can cause sparks to fly outside of the controlled fire area, resulting in wildfires in an open area or house fires with wood-burning fireplaces.
Different species of wood also inherently contain varying amounts of moisture, thereby increasing or decreasing the risk of popping. For example, red cedar wood is known to produce more sparks than birch wood due to moisture level and dry weight per volume.