Alpha map textures that store the splat weights of the terrain layers.
Each texture stores four layers, one per RGBA channel. The textures are separate Texture2D objects. Unity adds them to the TerrainData asset as sub-assets only if the TerrainData is already an asset when they are created, so save a new TerrainData as an asset before you assign terrain layers.
To make a change to the weights from an Editor script undoable, for example with TerrainData.SetAlphamaps, register both the TerrainData and these textures with Undo.RegisterCompleteObjectUndo before the change.
If you register only the TerrainData, undo does not restore the weights.