If you could look down into the flame, you'd see that oxygen molecules from the air interact with wax molecules and have a chemical reaction. And the products of the reaction, that means the stuff that's produced, is water vapor, carbon dioxide gas, and heat, and light.
The more electronegativity atom attracts electrons more strongly and gains a slightly negative charge, the less electronegative atom has a slightly positive charge.