Original: Particle-antiparticle pairs can annihilate each other, producing photons; since the charges of the particle and antiparticle are opposite, charge is conserved.
Simplified: Particle-antiparticle pairs can annihilate each other if they are in appropriate quantum states.