Folding (wrinkles) in cortex: Why is surface area more important than volume?
The key point is that the brain is not a uniform structure. The outer layer, known as grey matter, is a relatively uniform and flat structure. Underneath the grey matter is white matter. An overly-simple characterization of these two areas is that grey matter performs computations, and white matter lets different areas of grey matter talk to each other. Here's an image of a dissected brain from wikipedia where you can clearly see the ring of grey matter.



One reason for the folds might be that if you want to fit a flat structure (like grey matter) into a tight space, folding it is one way to fit more of it. Another aspect of this is that the folds bring different areas of grey matter closer together, which means less white matter is needed to connect the areas together.