This happens because as the barley cooks, it releases starches that can create foam and bubbles in the pot and the foam can spill over the sides of the pot. To prevent this 1. make sure to use a pot that is large enough 2. lower the heat to a gentle simmer once the barley comes to a boil 3. stir occasionally as it cooks 4. slightly loosen the lid which will allow some of the steam to escape