Suppose $k$ is a commutative unital ring, and $M$ is a left $kG$-module where $G$ is a finite group. If $H$ is a subgroup of $G$, why is the module of coinvariants $M_H=M/\langle m-h\cdot m:m\in M, h\in H\rangle$ isomorphic to $k(G/H)\otimes_{kG}M$?
I know that the module of coinvariants of $M$ under $H$ can also be interpreted as $k\otimes_{kH} M$ where $H$ acts trivially on $k$ on the right, the isomorphism given by $$ k\otimes_{kH}M\to M_H:a\otimes m\mapsto a\bar{m}. $$
Why is either of these isomorphic to $k(G/H)\otimes_{kG}M$? How does $kG$ act on $k(G/H)$ on the right, since $H$ need not be normal? I was trying to construct an isomorphism in a similar way assuming a trivial right action, but I don't think it works.