I don't quite get your question, perhaps reformulate or or something?
Either way:
- "gg_unit_" just means that it is a preset unit (just like you have gg_cam_ for camera's, gg_rct_ for regions, ...).
- the "hpea" is the raw ID of the unit (you can see this by going to the object editor and pressing CTRL + D, the name "peasant" will change into "hpea").
- "0001" is the Xth unit you placed on the map (starting from 0000).
so gg_unit_hpea_0001 means it is the second unit you placed and it is a peasant.
gg_unit_h00O_0052 is the 53th unit you placed and has as raw ID h00O (meaning it is a custom unit).