when a carbon is bonded to an atom like hydrogen, the higher electronegativity of carbon allows it to take all electrons of hydrogen from the shared bond allowing it's oxidation to decrease so in CH4, the oxidation state of carbon would be -4 (oxidation state = no. of valence electron in free atom - no.of valence electron in bonded atom; = 4-8 = -4) but in the case of bonding to other carbon atoms, the electronegativity difference is zero, so the electrons are shared and stay in neutral position, in the case of C2H4 ( = 4 - 6 = -2)