This is thanks to a protein called myoglobin, which also is what makes the raw red meat look red, not blood, as many people think. Myoglobin is a protein that stores oxygen in muscle cells, very similar to its cousin, hemoglobin, which stores oxygen in red blood cells. This oxygen store is necessary for muscles which need immediate oxygen for energy during continual usage. So how does the myoglobin end up making the meat turn brown when cooked? This darkening effect is due to the oxidation state of the iron atoms in myoglobin.
When the myoglobin is exposed to oxygen, before you cook the meat, the iron atom oxidation level is +2 and it is bound to a dioxygen molecule (O2), which makes the meat appear bright red. As you cook the meat, this iron atom loses an electron and goes to a +3 oxidation level with this process ending up turning the meat brown. White meat, on the other hand, doesn’t turn dark brown like red meat because it has significantly less myoglobin in it. In fact, the myoglobin levels are actually one of the main factors that officially distinguish white meat from red meat.