The Overlock Foot (Bernina #2/2A - Janome Foot C - Husqvarna-Viking Edging Foot J) is used to overcast the edge of fabric. It is similar to what a serger does - and is used with a zig-zag or similar stitch. You would use this foot when you need to finish the edge of fabric so it doesn't fray when washed. With some machines, you can use it when making a satin stitch.
What makes this foot work? There is a pin that holds the thread - which would normally pull the fabric - as you sew. And you'll use that pin as a guide to line your fabric up with. A word of caution: it is difficult to back-stitch with this foot. Watch the video below to see how it works.