When you do a knit stitch the yarn has to be behind the needles and when you do a purl stitch the yarn has to be in front of the needles.
So when you have just done a knit st and want to purl the next you need to bring the yarn between the needles to the front.
And when you have just done a purl and want to knit the next you need to pass the yarn to the back, again between the needles.
Not repositioning the yarn in either case will result in an extra loop on the needle, as will repositioning it by going round the outside of the needles.
One technique for deliberately increasing is the "yarn over " and not repositioning the yarn between ks and ps is one way of doing it.
Hope this helps!