Pickling foods results from the addition of an acid such as acetic acid (vinegar) or citric acid (lemon juice) to foods. The acid both flavors the food and prevents certain microorganisms from growing. This is important in preventing the growth of the bacteria that causes botulism. It cannot grow in acid foods (pH 4.6 or below).
NCHFP Resources - How to pickle foods.