When we have only knit stitches then we first insert the needle from front to back as in first figure and then for the next stitch from back to front as shown in the second figure.
And then we pass the needle under horizontal baron the armhole side.
When we have purl stitch after the knit stitch then we insert the needle for the knit stitch from front to back through which we have already passed our needle for the previous stitch and then for the purl stitch we insert the needle from front to back. As shown in the figure below.inthis waywe have to pass the needle through each stitch twice.
After that we pass the needle through horizontal bar on the armhole side.