The left cosets partition the group and each has ∣H∣ members, proving the formula. If ∣G∣=p is prime, the only divisors are one and p, so H={e} or H=G. Hence agroup of prime order has no nontrivial proper subgroups.
The word “nontrivial” is necessary: {e} is a proper subgroup of every prime-order group. Thus the source's shorter wording cannot literally exclude all proper subgroups.