I am reading a solution to another problem that counts the homomorphisms. I don't get why $|G|/|\phi(G)|$, I get that $|F|/|\phi(G)|$ by Lagrange's theorem.
I guess it has to do with if $|G| = m$, then $\phi(g^m) = \phi(g)^m$, so there are $m$ copies which divide $|G|$?
Think about the first theorem of homorphism. It tells us that $G/ker(\phi)\cong Im(\phi)$ so if the group $G$ is finite so you' ll get the answer.