The brain is composed of neurons. Each neuron either fires or it doesn't, just like on or off in a computer. This is determined by chemical reactions in and outside the cell. A powerful enough computer can simulate this down to the atomic level, it's just physics. Just because the computers we build don't function the same as the brain doesn't mean that the brain isn't a computer. Some attempts at AI have taken this approach, and while they generally work, we don't yet have the processing power to scale it.
When a certain stimulus happens, the effects it has on the brain, which include thoughts, is predictable and computable by doing the physics. We just have this illusion of "free will" and making choices. Our personalities are simply the result of how our brain's wiring developed from our environmental stimuli.
This also brings to light an important topic in philosophy of science: determinism. Is the world deterministic or not? If it's not, then physics and the sciences simply don't work. If the world is deterministic, which all evidence we have says that it is, then free will cannot exist. It's just easier and more comforting for people to pretend we have free will.