I'm having some difficulty following the below proof.

I understand everything up to the last three lines; I specifically don't understand how they're concluding that the intersection of the subgroup generated by $gH$ and $K/H$ is equal to $\{H\}$, or in different terms the identity element in $G/H$. Moreover I'm not sure how they arrive at the conclusion that the internal product of $k$ & the group generated by $g$ is equal to $G$, though I think it has to do with the isomorphism theorems?
If anyone could spell out what steps I'm implicitly missing here I'd very much appreciate it, since I've been stuck on it for the last hours.
Thank you!