Showing that if $G$ is abelian of exponent $n$, then $|\operatorname{Hom}(G,\mu_n)|= (G:1)$ I encountered this result in the following context (p.72 of Milne's Fields and Galois Theory):

Could you please help by explaining to me why this result is true?
In particular, I am interested why we need that $G$ is abelian. Also, I am wondering why one would write $(G:1)$ instead of $|G|$.
I know what it means that $G$ has exponent $n$ (it is mentioned in the text) and $\operatorname{Hom}(G,\mu_n)$ is the set of group homomorphism between the abelian group $G$ and the sets of all $n$-th roots of unity $\mu_n$. The issue is that I cannot plug all arguments together.
 A: The Pontryagin dual of a finite abelian group $A$ is another finite abelian group $\hat{A}$ which can be defined in several equivalent ways: it is any of the groups
$$\text{Hom}(A, S^1) \cong \text{Hom}(A, \mathbb{Q}/\mathbb{Z}) \cong \text{Hom}(A, \mathbb{Z}/n\mathbb{Z})$$
where $n$ is the exponent of $A$, the point being that we any homomorphism from a finite abelian group into $S^1$ necessarily lands in the subgroup $\mu_{\infty} \cong \mathbb{Q}/\mathbb{Z}$ of elements of finite order, and in fact in the subgroup $\mu_n \cong \mathbb{Z}/n\mathbb{Z}$ of elements of order dividing $n$.
The Pontryagin dual $\hat{A}$ is classically known to be non-canonically isomorphic to $A$, so in that respect it behaves like the dual of a vector space. This is easy to check using the structure theorem for finite abelian groups, which reduces us to checking the cyclic case, where it's clear that $\widehat{\mathbb{Z}/n\mathbb{Z}} \cong \mathbb{Z}/n\mathbb{Z}$. In particular, the two have the same size.
If $G$ isn't abelian then any map from $G$ to an abelian group such as $\mu_n$ necessarily factors through its abelianization.
