In Andrew Kobin's script on Algebraic Geometry I found on page 355 a comment I would like better understand. It states
Another way to view formal smoothness is as an abstraction of Hensel's Lemma.
Formal smoothness of a scheme $X \to S$ is the property that for every $S$-scheme $Y$ and every infinitesimal subscheme $Y_0 \subset Y$ (taht is defined by a nilpotent ideal sheaf in $Y$) , the canonical morphism
$$Hom_S(Y,X) \to Hom_S(Y_0, X)$$
is surjective. Well, why this property can be regarded as abstraction of Hensels lemma? The Hensel's lemma I familar with on lifting polynomials under certain conditions from $(R/m)[X]$ to $R[X]$ where $A$ local complete with max ideal $m$ not involves any assumptions that $m$ is nilpotent. In which sense the above can be regarded as an abstraction?
Another question on general properties of Henselian rings. I heared fleetingly (but forgot the concrete context) that schemes over henselian local rings have generally a rich divisor theory that somehow allows in certain way to "reduce" the analysis of divisors on $R$-scheme $X$ ($R$ local hensel with max ideal $m$ and residue field $\kappa=R/m$) to that on the special fiber $X \times_R \kappa$ in the sense that a "lot of information" of theory of divisors on $X$ maybe already extracted on the study of divisors on $X \times_R \kappa$ using formal techniques by lifting results from $X \times_R R/m^i$ to $X \times_R R/m^{i+1}$ in much more "fruitful way" as if we work without Henselian context.
At least it seems that henselian assumption "garantees" that much more information is conserved by passing to the special fiber as without this assumption. Could somebody give short insight into this correspondence principle and motivate how henselianess cames exactly in fruitful manner into the game? Or a recomendable reference where these ideas are made precisely and explaned in details?