This concept is just being introduced to me in my QFT course, and my instructor mentioned that if a scalar field $\phi$ has $U(1)$ symmetry, then you can make a suitable gauge transformation $\phi \rightarrow e^{i\theta}\phi$, and the underlying Lagrangian is invariant under such a change. I understand how if $\theta$ is a constant, then you have a global transformation, as you are rotating by the same angle at every point in space.
But he then mentioned that if you make $\theta$ a function of position, $\theta(x)$, such that $\phi \rightarrow e^{i\theta(x)}\phi$ and the Lagrangian is still invariant under such a change, this corresponds to local gauge invariance. He mentioned this has to do with locality.
I suppose my misunderstanding is, I don't see how making the phase dependent on each point in space says anything about locality. What does locality mean here, what is local gauge invariance, and why does $\theta \rightarrow \theta(x)$ imply it? It seems like local gauge invariance is a much more powerful property to have rather than global. Is this true?
Apologies if the lingo isn't quite correct when referring to these ideas. I am still learning the language.