A 90-second demonstration of just one way video games can procedural-generate two-dimensional worlds. This is a "color-based auto-tiled" approach to world building.
While this method may not be exactly what games like Binding of Isaac and Spelunky are using, it can produce similar results.
Procedural generation in 2D indie games
You can watch the animation below on The Step Event YouTube channel.