Why do the hazard lights blink when break?

if you mean: "why do hazard lights flash when brakes are on", then the answer is because vehicles are equipped with a hazard light relay that supercedes the brake lights. This way, slow moving vehicles can operate under hazard lighting.