I heard that the action of classical mechanics can be seen as the complex phase of the wave function of quantum mechanics
$$\psi=\rho \exp\left(\frac{iS}{\hbar}\right)\tag1$$
I am more familiar with the stationary state wavefunction of the form
$${\displaystyle \Psi (\mathbf {r} ,t)=\psi (\mathbf {r} )e^{-i{Et/\hbar }}}\tag2$$
Equation $(1)$ seems really nice in that it connects classical mechanics (action) to quantum mechancis (wavefunction), but I can not wrap my head around it. I can not find any derivation of it or any physical meaning.
I found only that when we input $(1)$ into the Schrödinger equation and take the classical limit we obtain the Hamilton-Jacobi equation.
What is the physical interpretation of equation $(1)$ and how did we obtain it?