Roasted beans give off CO2, which is displaced by oxygen during the off-gassing process. Fresh roasted beans are full of CO2, which mask the aromatics/lipids. The first day or two, most of the off-gassing is all CO2. After the first day or two, the aromatics themselves start to off-gas, taking flavor with them.
It's basically oxidation and enzymatic breakdown after that. So they don't ferment, they just oxidize (a lot of the flavor in coffee comes from aromatics and oils/lipids, so it's similar to butter getting bland if it oxidizes for a while).