Both
carbon and nitrogen are required for organism growth - which is primarily bacteria in the case of composting. In terms of the nutrients required for microrganism growth, roughly 30 to 60 parts by weight are used for each part of nitrogen. So if the C:N ratio of the materials you make your
compost pile out of is close to what the microorganisms need - the organisms grow at a fast rate and composting occurs relatively quickly. Faster composting means you get finished compost faster and it also means the pile will heat up significantly which kills unwanted seeds. Heat will also keep a pile working in winter.
In general, a C:N ratio around 25:1 or 30:1 is best because the organisms can process a little excess nitrogen. If nitrogen is too high - composting slows, ammonia and odors can be generated. If carbon is too high - composting is slower, but that is about it.