Background
When trying to prove that a group G has a non-trivial centre if its order is a power of a prime $p$, there involves a step in which we claim the number of left cosets of a centraliser subgroup is also a power of $p$.
Problem
Let $q|p^k$, then why are we sure that $q = p^i$ where $0\leq i <k$? In other words, why are we sure that $q$ can only be a power of $p$?
$$ q|p^k \iff p^k \bmod q =0 \iff p^k=d \cdot q$$ However, $d$ can't be anything else but: $$d=p^\lambda, \quad 0<\lambda\leq k $$
because $p$ is a prime ($p$'s powers have only divisors $1$ and other $p$'s powers) and thus $$p^k=p^\lambda \cdot q \iff q=p^{k-\lambda}=p^i, \quad 0 \leq i<k$$