When the beans reach the temperature of 400F during the roasting process, the beans “crack.” The bean develops oils in a process called pyrolysis. The outer part of the beans darkens.
When the beans “crack” a second time, the hot beans are then dumped from the roaster and cooled immediately, usually with cold air. During the process of roasting coffee beans, coffee oil gathers in pockets throughout the bean. This substance is forced out to the surface of the beans of darker roasts, as moisture is lost. Hence darker roasted beans have this oily appearance.