It is a classical fact that a topological group $G$ admits the structure of $p$-adic analytic group iff it contains an open subgroup which is pro-p uniformly powerful. I was reading the related section on "Analytic pro-p groups" (second edition) of Dixon, Du Sautoy, Mann and Segal when I found a refinement of this result.
They claim in Corollary 8.34 that $G$ is a compact p-adic analytic group iff it contains an open normal pro-p uniformly powerful subgroup of finite index. They said this follows from the previous theorem and other facts regarding uniformly powerful groups but they do not name the exact proposition/lemma/theorem. I tried to look in section 4 for the possible result they refer to but without success. Could you please explain why the normality is equivalent to the compactness?
Also, I was told that if a $p$-adic analytic group is compact then it is a profinite group. Can you explain this or give a reference?
After I while I understood the answer: the key result regarding powerful pro-p group is theorem 3.13 of the book (not in section 4).
For the first implication: $G$ compact p-adic analytic has a normal uniform subgroup. If $G$ p-adic analytic contains $U$ pro-p powerful the idea is to apply theorem 3.13 to an appropriate corrected $U$: first $G/U$ must be finite ($G$ is compact and $U$ is open), take $T$ a transversal set and define $V= \bigcap_{t \in T}tVt^{-1}$. You can verify this is a normal open subgroup of $G$ and it is pro-p of finite rank (apply thm 3.9). Then by theorem 3.13 $V$ contains $W$ powerful characteristic pro-p which must have finite rank.
Now thm. 4.2 tells us that $P_k(W)$ is uniformly powerful for $k$ big enough. And since $W$ is characteristic in $V$ also $P_k(W)$ will be characteristic in $V$. Now we have $P_k(W)$ characteristic in a normal subgroup of $G$, hence it is normal in $G$ and this will be the uniform subgroup we wanted.
My first idea was that you had to modify the starting $U$ uniform to make it normal, it turned out that you needed only the fact that it is pro-p to find an appropriate subgroup of it with the desired properties.
The inverse implication is easy: you just have to observe that the cosets form an open cover of $G$ by compact spaces to deduce $G$ is compact.
Regarding my second request: the point is that an analytic group misses only compactness to be a profinite group: by the classical theorem it contains $U$ uniformly powerful open subgroup, it is easy to see that the open subgroups of such $U$ form a basis of neighbourhoods of $1$ in $G$.
An interesting fact is that you have the group is profinite but not necessarily pro-p: an easy example is given by $\mathbb{Z}_p^{\times}\cong C_{p-1}\times (1+p\mathbb{Z}_p)\cong C_{p-1}\times \mathbb{Z}_p$. This contains $\mathbb{Z}_p$ as open subgroup of index $p-1$.