The rubber gains heat by conduction from the mold surfaces and “cures”. When the rubber has had sufficient time to cure, the mold can be opened and the part removed.
Compression molding is a relatively simple process and is often used for components required in fairly low quantities. Mold costs are generally lower. Parts molded by this method will always have some flash because the mold surfaces are held apart by the necessary excess rubber in the “blank”.