I'm working my way through Griffith's Introduction to Electrodynamics. In Ch. 10, gauge transformations are introduced. The author shows that, given any magnetic potential $\textbf{A}_0$ and electric potentials $V_0$, we can create a new set of equivalent magnetic and electric potentials given by:
$$ \textbf{A} = \textbf{A}_0 + \nabla\lambda \\ V = V_0 - \frac{\partial \lambda}{\partial t}. $$
These transformations are defined as a "gauge transformation". The author then introduces two of these transformations, the Coulomb and Lorenz gauge, defined respectively as:
$$ \nabla \cdot \textbf{A} = 0 \\ \nabla \cdot \textbf{A}= -\mu_0\epsilon_0\frac{\partial V}{\partial t}. $$
This is where I am confused. I do not understand how picking the divergence of $\textbf{A}$ to be either of these two values actually constitutes a gauge transformation, as in it meets the conditions of the top two equations. How do we know that such a $\lambda$ even exists for setting the divergence of $\textbf{A}$ to either of these values. Can someone convince me that such a function exists for either transformation, or somehow show me that these transformations are indeed "gauge transformations" as they are defined above.