those are airlocks. They let gas out but not in. Lactic acid fermentation happens more readily in the absence of oxygen. You can have lactic acid fermentation without this setup, but it's much easier to control the end product with the airlock setup.
If oxygen is present you're more likely to get other types of bacteria/fungus doing metabolic stuff and screwing up the process by making things taste horrible (or worse...)
