The Sn in SnO has been reduced to Sn, and the C has been oxidized to CO₂.
Oxidation is the gain of oxygen atoms. C has gained O atoms, so C is oxidized.
Reduction is the loss of oxygen atoms. Sn has lost an O atom, so Sn is reduced.
The oxidation number of Sn decreases from +2 to 0. The Sn atom gains two electrons.
The oxidation number of C increases from 0 to +4. The Sn atom loses four electrons.
The reaction occurs because carbon is above tin in the activity series. It is able to displace tin from its compounds.
We could say that the C-O bond in CO₂ is stronger than the Sn-O bond in SnO, so CO₂ is the favoured product.