A gauge theory has internal degrees of freedom that do not affect the foretold physical outcomes of the theory. The theory has a Lie group of continuous symmetries of these internal degrees of freedom, i.e. the predicted physics under any transformation in this group on the degrees of freedom. Examples include the $U(1)$-symmetric quantum electrodynamics and other Yang-Mills theories wherein non-Abelian groups replace the $U(1)$ gauge group of QED.
The gauge groups of such theories are proposed to model experimentally observed symmetries of the described physical processes. These symmetries can include observed conserved quantities in experiments. The requirement to have a certain gauge group to explain observed symmetries guides the theorist towards possible theoretical descriptions: e.g. to a Lagrangian invariant with respect to transformations belonging to the gauge group. The gauge group of the Standard Model is $SU(3)\times SU(2) \times U(1)$, where $SU(3)$ is the gauge group of quantum chromodynamics and $SU(2) \times U(1)$ the gauge group of the electroweak force.
Mathematically, a gauge theory is a fibre bundle with the observable physical model as the bundle's base space and the structure group the group of gauge symmetries. The fibres represent the "unphysical" (unobservable) degrees of freedom.