Four jobs, not one
It is easy to assume roasting is just "cooking the beans." It is doing four separate things at once, and knowing which is which tells you what to change when something goes wrong.
1. It develops flavour
This is the one everybody knows. Raw cacao and roasted cacao taste dramatically different, and the difference is chemistry, not temperature for its own sake — heat drives reactions between sugars and amino acids that create aromatic compounds not present in the raw bean.
This is also the only stage of chocolate making where flavour is created rather than handled. Cracking, winnowing, refining and tempering are mechanical — done well they preserve what the roast produced, but they cannot add to it. Which is why roast faults are not recoverable downstream, and why a bad roast is a batch you finish out of stubbornness.
What "too far" and "not far enough" taste like is the chocolate maker's side of this, and Chocolate Alchemy covers it properly. Our concern is the heat that gets you there.
2. It drives off moisture
Cacao arrives dried but still carries water — trade specifications commonly cap it around 7–8%. Until that water leaves, the beans physically cannot climb much past the boiling point of water no matter how hard you push, because the energy goes into evaporation instead of temperature.
That is why every cacao roast has a drying phase whether you planned one or not, and why it shows up as a distinct flattening on a bean-temperature graph. Rush it and you scorch the outside of a bean that is still wet inside. See moisture and what it does to your roast.
3. It releases the husk
The most under-appreciated job. Roasting dries and embrittles the shell so it separates cleanly from the nib at cracking and winnowing.
Under-roast and the shell clings — you either lose nib along with the husk, or carry husk through into the melanger, where it becomes grit in the finished bar. Over-roast and the shell can shatter into fragments that are harder to separate by winnowing. So the roast is quietly setting your yield, before flavour even enters into it. See how your roast sets your winnowing yield.
4. It handles food safety
Cacao is fermented and sun-dried, frequently on open patios and mats. Roasting is the step that applies real heat to it, and it is a routine part of why the finished product is safe to eat. It is not a reason to over-roast, but it is a reason not to skip the roast entirely.