The land mass of current-day North America was near the equator during the Carboniferous Period - in the tropics. This was a great environment for lush plant growth. This is also the time when plants with lignin and complex cellulose were beginning to evolve (ferns). Forests of trees up to 100 feet tall made up coastal swamps. Below is a fossil of the tree trunk (this one from lepidodendron)- all the indentations are thought to be attachment points of leaves or branches.
So, what's the big deal? Well this is the cool part (to me). Since woody plants were a pretty new thing, the bacteria had not yet evolved the appropriate enzymes to break down and decompose them. So when those plants died they stuck around.
Then add to this the fact that there was a lot of glaciation at the time and you have the recipe for coal. ("Huh?" you say... I know, I didn't get that at first either.) The reason ice caps are important is that they would melt, causing transgressions (rise in sea level) which would flood the swamps and bury them in sediment, preserving them where they would continue to be compacted and eventually become coal.
The geek factor? Pretty sweet that these things formed largely due to good evolutionary timing - woody plants: 1, bacteria: 0. Good geological timing with the transgression as well. Nice orchestration there, and we get fossil fuels, the industrial revolution, and much of modern technology out of it.