So I have been experimenting with terrain with the Kardashev 3 mod, so this stuff is relatively fresh on my mind.
First, the terrain graphics are generated in layers. The first layer is the most complex layer, the flat land terrain, such as Tundra, Plains, Grassland, Coast, Sea, Ocean. If you look in the game terrain art files, you see things named like xdgc.pcx, or wCSO.pcx or something. The first letter indicates the type of terrain class x is for land tiles, and w is for water only. C for coast, S for Sea, O for Ocean, D for desert, G for grassland, P for plains, and T for Tundra. The graphics themselves are actually generated in the intersecting corners of tiles, rather than centered on the tile itself. Basically if you have 1 grassland tile in game, you splice 4 different graphics together, based on the tile types adjacent to it. Each graphic is the corners of 4 different terrain blended together.
For example, if you have the following terrain configuration:
Green is grassland, yellow is plains, white we don't care.
The central grassland tile is comprised of 4 tiles, in red. The top one is made of 4 corners, the south belonging to grassland, while the north, east, and west belong to plains. For the bottom one, the north belongs to grassland, west, east, and south belong to plains, etc.
If you look at the graphic files, they go through each of the combinations of the 3 provided graphics. However, there isn't overlap between Desert and Tundra, and Tundra and Plains. This is the reference grid that I use when stitching the terrain together:
Basically, xABC.pcx corresponds to A, B, and C in the terrain.
The next layer that is generated are the forest layers. Forests are applied on top of the flat lands, and they are determined by whatever they happen to be on top of. "plains forest.pcx" is generated on top of plains, "tundra forests.pcx" on top of tundra, etc. Jungles are also included in the various forest .pcx files, in the labeled Jungle section, however this is only really applied using the "grassland forests.pcx" file. The tiles are centered on the center of a tile rather than corners. I don't know if you can place Jungle terrain on top of plains and have it show up as the plains version, as I haven't tried. Any of the invisible colors are rendered with whatever terrain is underneath, and if the forest spills out over its assigned tile, the forest will graphically do so as well.
The top layer generated are the mountains and hill files. In the graphics files, there is a tile and a band above it which is the pink color, which gives it the illusion of height by designating area where the mountain rises above the surrounding terrain and graphically blocks the tile behind it. The tiles are centered on the center of a tile, rather than corners. Fairly straight forwards otherwise. If there are nearby jungles or forests, the mountain and hill tiles generate using the "mountain forests.pcx" or "mountain jungles.pcx" files. I'm not exactly sure when it decides there are forests or jungles on top, but the concept is there. Beneath mountains are always grassland, so the invisible color will show grassland underneath.
Next, you get the rivers and resources.pcx applied on. The rivers are applied on the edges of tiles, and if there are mountains involved, have waterfall graphics. If it passes next to a desert tile, it applies the floodplain.pcx graphic over the desert tile, and if it exits to water, it applies the deltaRivers.pcx file.
Terrain improvements are next to be generated, such as roads, rails, irrigation/mines (Irrigation has different graphics based on the base terrain, indicated by "irrigation DESETT.pcx" for desert, "irrigation PLAINS.pcx" for plains, "irrigation TUNDRA.pcx" for tundra, "irrigation.pcx" for grassland.)
Finally, cities and rubble is generated on top of that.