Calcium carbide is actually CaC₂, not Ca₂C. While it may seem logical that the formula should be Ca₂C to balance the charges, the correct formula is CaC₂.
In CaC₂, the calcium ion (Ca²⁺) has a +2 charge, and the carbide ion (C₂²⁻) has a -2 charge. Therefore, the overall compound is neutral.
The reason why it's not Ca₂C is because that compound doesn't exist. If we try to form Ca₂C, we would need two calcium ions (2 x Ca²⁺ = +4 charge) to balance the charge of the carbide ion (C²⁻ = -2 charge), which would result in a net charge of +2. Therefore, Ca₂C cannot form as a stable compound.
I hope that clears up your confusion!