It's a symmetry in an abstract space of fields (or field operators in the quantized case).
The local gauge symmetry of classical electrodynamics is easily seen by the fact that the physically observable fields are \vec{E} und \vec{B} fulfilling Maxwell's equations. These consist of two constraint equations (the homogeneous equations)
\vec{\nabla} \times \vec{E}+\partial_t \vec{B}=0, \quad \vec{\nabla} \cdot \vec{B}=0.
These equations can be identically satisfied by introducing a scalar and a vector potential. Indeed since the magnetic field is solenoidal, it can be written as
\vec{B}=\vec{\nabla} \times \vec{A}.
Now, plugging this in the first constraint, gives
\vec{\nabla} \times (\vec{E}+\partial_t \vec{A})=0,
which means that the field in the brackets has a scalar potential:
\vec{E}+\partial_t \vec{A}=-\vec{\nabla} \Phi
or
\vec{E}=-\partial_t \vec{A}-\vec{\nabla} \Phi.
A given scalar and vector potential thus give electric and magnetic fields as
\vec{E}=-\partial_t \vec{A}-\vec{\nabla} \Phi, \quad \vec{B}=\vec{\nabla} \times \vec{A}.
On the other hand, obviously, for given electric and magnetic fields, the potentials are not unique. One can add the gradient of a scalar potential to the vector potential without changing the second equation:
\vec{A}'=\vec{A}+\vec{\nabla} \chi
leads to the same magnetic field as \vec{A}. To also obtain the same electric field, one has to set
\Phi'=\Phi-\partial_t \chi.
Indeed, then we have
-\partial_t \vec{A}'-\vec{\nabla} \Phi'=-\partial_t \vec{A} - \vec{\nabla} \Phi - \partial_t \vec{\nabla} \chi + \vec{\nabla} \partial_t \chi=-\partial_t \vec{A} - \vec{\nabla} \Phi=\vec{E}.
Thus one can implement an auxilliary constraint to determine the scalar and vector potentials from the inhomogeneous Maxwell equations. This is called "fixing the gauge". It is easy to show that gauge invariance implies necessarily the conservation of electric charges, i.e., that it is necessary for the theory to be consistent that the electric charge density and current fulfill the continuity equation,
\partial_t \rho+\vec{\nabla} \cdot \vec{j}=0.
The U(1) character of the transformation comes into play when considering a quantum theoretical model for matter. As a simple example take non-relativistic spinless particles, described (in the position representation) by a wave function, \psi.
First, quantum theory is invariant under global U(1) transformations since the absolute phase of the wave function cannot be relevant for physical observables, i.e., the wave function,
\psi'(t,\vec{x})=\exp(\mathrm{i} \alpha) \psi(t,\vec{x})
describes precisely the same state as \psi(t,\vec{x}) as long as \alpha \in \mathbb{R}.
The Schrödinger equation of a free particle can be derived from the Hamilton principle of stationary action with the Lagrange density
\mathcal{L}=\psi^* \mathrm{i} \partial_t \psi+\frac{1}{2m} (\vec{\nabla} \psi^*)\cdot (\vec{\nabla} \psi),
and indeed this Lagrangian is invariant under the above introduced U(1) transformation. However, for this the phase, \alpha must be independent of time and position. That's what's called a "global symmetry".
Now we'd like to make the symmetry local by inventing a covariant derivative such that the covariant space-time derivative transforms also just with a phase factor, even if this phase factor is space-time dependent. To that end one defines
D_t=\partial_t+\mathrm{i} q \Phi, \quad \vec{D}=\vec{\nabla} - \mathrm{i} q \vec{A}
Then one has from
D_t' \psi'=(\partial_t +\mathrm{i} q \Phi') [\exp(\mathrm{i} \alpha) \psi]=\exp(\mathrm{i} \alpha) [\partial_t \psi + \psi \mathrm{i} \partial_t \alpha + \mathrm{i} q \Phi' \psi] \stackrel{!}{=} \exp(\mathrm{i} \alpha) D_t \psi
that
\mathrm{i} q \Phi=\mathrm{i} q \Phi' + \mathrm{i} \partial_t \alpha \; \Rightarrow \Phi'= <br />
<br />
\Phi&#039; = \phi-\frac{1}{q} \alpha.<br />
<br />
Using the same arguments with the gradient, one finds<br />
<br />
\vec{A}&#039;=\vec{A}+\frac{1}{q} \vec{\nabla} \alpha.<br />
<br />
Thus, one has to introduce a scalar and a vector potential transforming under the local U(1) transformations as the electromagnetic fields with the gauge-transformation function, <br />
<br />
\chi=\frac{1}{q} \alpha.<br />
<br />
That means that the minimal way to make the Schrödinger equation invariant under local U(1) transformations is to use the covariant derivative instead of the usual partial derivatives in its Lagrangian, leading to<br />
<br />
\mathcal{L}=\mathrm{i} \psi^*(\partial_t+\mathrm{i} q \Phi) \psi +\frac{1}{2m} [(\vec{\nabla}-\mathrm{i} q \vec{A}) \psi]^* \cdot [(\vec{\nabla}-\mathrm{i} q \vec{A}) \psi].<br /><br />
<br />
The field equations for the wave function according to the Hamilton principle of stationary action leads to the Schrödinger equation for a particle in a given electromagnetic field, described by the scalar and vector potential. Thus, one can derive interactions in an elegant way by assuming that a previously global gauge symmetry of a model of free particles should be made a local gauge symmetry.<br />
<br />
Starting with more complicated groups than the U(1), e.g., SU(2) or SU(3), one can build more involved interactions, socalled non-abelian gauge theories (since these groups are non-abelian).