Pesto can oxidize and turn brown due to exposure to air. To prevent this, make sure the pesto is stored in an airtight container with a layer of olive oil on top or plastic wrap directly touching the surface to limit air contact.