Basic knitting, two needles and a ball of yarn, creates a rectangular product with straight edges. Human bodies, though, aren't straight. We curve and we need garments that can curve with us. So there must be a way to create that curve in a knitted project.
To create those curves, most notably for things like the heel of a sock or the collar of a sweater, many patterns rely on short rows and a wrap knit stitch.
For a pattern worked in stockinette, on a short row, you only knit a few stitches into your row. Then you will turn your work and purl those same stitches back. You now have one small portion of your project that has one more row than the rest of your work. The visual effect is that your project has a bit of a curve to it. Adding one short row to your work makes a minor curve. A more pronounced curve will involve multiple rows.
If you just knit your short row and turn your work to purl back without doing anything else, though, you will create a small hole in your project. As you would continue to knit, you would see a gap where the flow of the knitting was interrupted. This is where the wrap stitch comes in. You want to connect the last stitch on your short row with the stitch next to it so there will be no hole.
To wrap a stitch, knit to the point where you are ready to turn your work. Before turning your work, slip the next stitch from your left hand needle onto your right needle. Slip it purlwise to avoid any unnecessary twisting of the stitch. Then move your yarn from front to back. Now slip the stitch back onto the left needle and move your yarn back. You have now wrapped your yarn around the first stitch on your left needle. This simple yarn wrap will prevent a hole from appearing where you turned the work because you have kept a connection between the last stitch on your short row and its neighbor. This picture demonstrates the wrap in a contrasting color, so you can see the effect.
There is still one last step if you want a very tidy project. You want to hide the yarn wrap from view. To do so, the next time you come back to that stitch, pick up the wrap and knit it with the stitch it was wrapped around. The yarn wrap is now safely hidden away on the wrong side.
With this simple technique added to your repertoire, you'll be turning sock heels in no time. For a refresher course on any of the techniques mentioned, refer to the Knitter's Handbook.