  In recent years, several gauge-symmetric particle-in-cell (PIC) methods have
been developed whose simulations of particles and electromagnetic fields
exactly conserve charge. While it is rightly observed that these methods' gauge
symmetry gives rise to their charge conservation, this causal relationship has
generally been asserted via ad hoc derivations of the associated conservation
laws. In this work, we develop a comprehensive theoretical grounding for charge
conservation in gauge-symmetric Lagrangian and Hamiltonian PIC algorithms. For
Lagrangian variational PIC methods, we apply Noether's second theorem to
demonstrate that gauge symmetry gives rise to a local charge conservation law
as an off-shell identity. For Hamiltonian splitting methods, we show that the
momentum map establishes their charge conservation laws. We define a new class
of algorithms -- gauge-compatible splitting methods -- that exactly preserve
the momentum map associated with a Hamiltonian system's gauge symmetry -- even
after time discretization. This class of algorithms affords splitting schemes a
decided advantage over alternative Hamiltonian integrators. We apply this
general technique to design a novel, explicit, symplectic, gauge-compatible
splitting PIC method, whose momentum map yields an exact local charge
conservation law. Our study clarifies the appropriate initial conditions for
such schemes and examines their symplectic reduction.
