this is modern football, plus bad luck.
once a team is behind 1-0, it has to risk its defense for more attacking. Well it's always been like that, but with modern tactics, training methods and overall team strength and stamina, this effect strikes even harder. That's why many matches between equal teams nowadays end 5-1 like Netherlands vs Spain, or 4-0 like Germany vs Argentina in 2010.
then additionally that was bad luck for Brazil. 3 goals in 4 minutes can happen, but doesn't have to.
These 3 goals could as well have been missed chances.