Assuming physicalism, our brains are exactly the way they have to be given the initial conditions of the universe plus the causal laws of physics (which may have a probabilistic aspect).
One event leads to another, which leads to another, which leads to another, and after about 13.7 billion...