Why is every nilpotent-by-finite finitely generated pro-p-group always $p$-adic analytic

This is indeed true: every finitely generated nilpotent-by-finite (= virtually nilpotent) pro-$p$-group is $p$-adic analytic.

Since every finitely generated nilpotent group has all its subgroup finitely generated, a finitely generated nilpotent profinite group $G$ has a composition series by closed subgroups in which each successive quotient is procyclic. If $G$ is moreover pro-$p$, it follows that each successive quotient is either isomorphic to $\mathbf{Z}_p$, or a quotient thereof (which is finite). So these successive quotients are $p$-adic analytic. Since being $p$-adic analytic is stable under taking extensions, it follows that every finitely generated nilpotent pro-$p$-group is $p$-adic analytic, and the same follows with "nilpotent-by-finite".


If you work with finite rank all of these questions are quite trivial. In particular, you will notice that finite rank by finite rank is finite rank.