What divisions play against each another in the MLB playoffs?

The winners of the East, Central and West divisions are automatic playoff participants in the National League and the American League. Also, the teams with the best second-place records go in as wild cards.