The principle of gauge invariance states that the Lagrangian of a physical theory must be invariant under gauge transformations
based on Hamiltonian Equation and The Action Principle
Adding an arbitrary derivative to the action does not affect the motion of the particle
This is a principle of symmetry used to describe fundamental natural interactions such as Electromagnetism, Weak force, and Strong force.
Gauge invariance means that physical laws do not depend on a specific reference frame or background structure, and through this, theories such as the standard model of particle physics have been developed. Gauge invariance has made significant contributions to the development of quantum field theory.
It plays a role in unifying the forces found in nature. The reason for the existence of the fundamental force known as electromagnetism is that the Schrödinger equation describing electron dynamics must remain invariant under phase transformations