Returned dictionary key is the grass index inside TerrainData.detailPrototypes array and value holds the parent gameObject containing instantiated detail mesh prefabs with the same index.
TerrainData may contain thousands of detail mesh objects and instantiating separate GameObject for each one may not be fast and optimized solution.
It is better to combine exported grass objects into a single (or several) meshes and render them in one pass.
//Example of exporting detail meshes from TerrainData
//and instantiating gameObjects
//Exporting terrain mesh
Mesh terrainMesh = terrainData.TerrainToMesh().ExportMesh(100, 100);
//Creaing GameObject using terrain mesh
GameObject terrainGO = new GameObject("Terrain");
terrainGO.AddComponent<MeshFilter>().sharedMesh = terrainMesh;
terrainGO.AddComponent<MeshRenderer>().sharedMaterial = new Material(TerrainToMeshUtilities.GetDefaultShader());
//Exporting detail meshes from the TerrainData
TerrainToMeshPrototype[] detailMeshPrototypes = terrainData.TerrainToMesh().ExportPrototypes(TerrainToMeshEnum.Prototype.DetailMesh);
//Instantiating 100% of detail mesh prefabs as gameObjects
Dictionary<int, GameObject> detailMeshGOs = TerrainToMeshUtilities.ConvertPrototypesToDetailMeshGameObjects(detailMeshPrototypes, null, 100);
//Attaching instantiated detail mesh gameObjects to the terrainMesh
foreach (var item in detailMeshGOs)
{
item.Value.transform.SetParent(terrainGO.transform);
}