The Dirac Equation ("free Dirac") is a relativistic Equation of Motion (EoM) for a free ($V=0$) Spin $1/2$ particle (like an electron).
The free Dirac equation is invariant under global phase transformations (which can be easily seen).
The free Dirac equation is not invariant under local phase transformations. In order to make it invariant people change the normal partial derivative into a covariant derivative which introduces a four-vector-potential into the equation. Why is this a legitimate step? The introduction of a potential does not apply for a free particle so the situation this adapted equation describes is totally different from the original (free) Dirac equation.