Suppose a log's mass is 5 kg. After burning, the mass of the ash is 1 kg. What may have happened to the other 4 kg?
While burning any material, any constituent element that can be oxidized to gaseous state oxides like Carbon, Hydrogen, Nitrogen, Sulfur(These are the most common elements found in plant and animal body) etc. are oxidized to their corresponding oxides. This is what constitutes the major part of smoke. The black particles you see in smoke are unburnt small carbon particles which get detached during burning.
Smoke inhalation thus becomes dangerous to humans because relatively oxygen content of the smoke is less when compared to Atmosphere.
If you stop the burning before the log becomes ash the remains has unburnt Carbon materials which is why it is black.
The ash you see are metal oxides and other non combustible substances together.