Thanks!
Each terrain type has its own unique layer: water, sand, grass, rock, etc. Tiles are pre-rendered when the game loads, and terrain layers are used to draw tile borders in the correct order and in ways that make sense (a rock tile overflows on a neighboring grass tile, but not the other...