If you're new to knitting and wondering what all this "gauge" and "swatch" stuff is all about, here's a quick overview of those terms for you, before we jump into the why and how.
A swatch is simply a rectangular piece of fabric that you knit prior to starting a pattern as a test. You do this for a few reasons: to see if you like the yarn, the drape, to see if the yarn bleeds, and very importantly, to test gauge.
Gauge is the number of stitches that fit into rows/rounds per inch. You'll find a suggested gauge in all knitting patterns, the goal is to match the pattern's gauge with your swatch gauge so that your knitting matches the look and final dimensions of the pattern. You may be wondering why you won't get the same gauge as the pattern if you use the same yarn weight and needle size - learn why your gauge may be different below.
TIP: If your gauge doesn't match just slightly we recommend altering the needle size or yarn weight up or down accordingly. If you have a significantly different gauge, this knit tutorial may do the trick for you "How to Modify Gauge"