A Gauge Theory obtains from Maxwell's equations from a slight generalization of the target space and geometry: Consider matrix-valued objects instead of scalar-valued objects along with a scalar-valued metric.
Motivation: Object-valued tensors capture the noncommutative nature of spacetime geometry.
$$ \text{(the Action)}\quad S = \int F_{\mu \nu} F^{\mu \nu}\to S = \int \text{tr}\left( F_{\mu \nu} F^{\mu \nu}\right). $$
Maxwell's equations are $$ \partial_\mu F^{\mu \nu} = 0,\\ F_{\mu \nu} = \partial_{\mu} A_{\nu} - \partial_{\nu}A_{\mu} = \epsilon_{\alpha \beta \mu \nu}\epsilon^{\alpha \beta \sigma \rho}\partial_{\sigma}A_{\rho} = \delta^{\alpha \beta \sigma \rho}_{\alpha \beta \mu \nu} \partial_{\sigma} A_{\rho}. $$
Here $F_{\mu \nu}$ is the Faraday Field Strength Tensor and $A_{\rho}$ is an associated gauged potential. $\left (\delta^{\kappa \tau \sigma \rho}_{\alpha \beta \mu \nu} \text{ is the Generalized Kronecker delta.} \right )$
On curved space, these equations become $$ \nabla_{\mu} F^{\mu \nu} = 0,\\ F_{\mu \nu} = \delta^{\alpha \beta \sigma \rho}_{\alpha \beta \mu \nu} \nabla_{\sigma} A_{\rho}. $$
Note $F_{\mu \nu} = \epsilon_{\alpha \beta \mu \nu}\epsilon^{\alpha \beta \sigma \rho}\nabla_{\sigma}A_{\rho}$ is a tensor as the metric is scalar-valued. Gauged Potential: $A_{u}$.
The local symmetries of this theory can be teased out of the Action above.
This is a refined Gauge theory with the metric explicit.
Is there a more intuitive way to motivate the Gauge theory?
Gauge theories are now regarded as fiber bundles with a connection, If the gauge group is U(1) one gets electromagnetism. When a more complex Lie group is used, such as SU(3) (quantum chromodynamics) one gets Yang-Mills theory. Non-abelian gauge theories are very complicated. The connection is normally described by a vector potential $A^j_\nu$, where j refers to a group generator index and $\nu$ is a spacetime index.