In a nutshell, it is a chemical process call pyrolysis, the thermochemical decomposition of volatile materials in a no oxygen/low oxygen environment and high heat.
Initially, when you first start burning wood, wood chips, pellets, etc, the fuel is cold. The burning process is incomplete, causing the white or grey smoke as particulates and tars (aka creosote) are released from the fuel. As the fuel heats up and the burning process reaches a state of equilibrium in the burn chamber (fuel-air-heat in balance), the burning process becomes more efficient. The raw fuel in the woods carbonize prior to release. They essentially become caramelized, which becomes thin blue smoke.
White or grey smoke contains really bad stuff for flavor, most commonly ash and creosote. There is a big dispute whether it also contains unhealthy levels of PAHs, or polycyclic aromatic hydrocarbons, which are carcinogenic.
Bottom line, don't load your food until you see thin blue smoke.
PS edit: as a side note, charcoal briquettes tends to have thin blue smoke right from the start. Don't let that fool you. One of the reasons charcoal briquette manufacturers say to let the charcoal ash over completely before use, it to prevent the stuff used in the briquette from flavoring your meat. Just recently, after switching from Kingsford Blue Bag to Royal Oak Ridge, I was using my grill to help use up the 120 lbs of KBB I have left. I didn't let the charcoal completely ash over before I loaded the meat. Bad move. Even though I did not use a liquid starter in my chimney, I tasted what could only be described as fuel. After decades of KBB use, switching to the new RO Ridge, then back to the KBB, I tasted what people have been saying about KBB for a long time. Bottom line, let the charcoal ash over completely before use.