Roasting cacao virtually sterilises the cacao bean. It also helps separate the outer husk from the inner bean making cracking and winnowing much easier.
Roasting the beans correctly would boost the potency of some bio-active and antioxidant compounds while protecting desired sensory aspects of chocolate. The vinegar smell from fermenting is driven off. Raw beans don’t taste like chocolate. Roasted beans do.