IEC No. 5017, better known as Earth Ground, is the result of many over a 100 years of organic evolution, convention, and most recently, rigorous international standardization.
The earth ground symbol owes its origin to the same origin that many other symbols do (notably the inductor, capacitor, and American resistor symbol): the patent drawings of Nikola Tesla.
What is arguably one of his greatest contributions is one without any patent and has no material form: the abstraction of bulk properties (inductance, resistance, capacitance) into components that possess one of these properties but very little of the other two. I don't know to what degree this attribution is fair, as Edison was also beginning to this at the same time, and considering Tesla at one point worked for Edison, and they doubtlessly were aware of each other's patents (they weren't the mortal enemies/mega rivals of modern mythos, closer to peers in an emerging field), but at the very least, that abstraction arose from Tesla, Edison, Marconi, and the great inventors the era all building off of each other.
The specific imagery, however, are obviously from Tesla, simply because his are the ones that look like our present day symbols.
Originally, these drawings represented real structures for the sake of patent submissions, but certain structures were reused over and over, and drawn over and over, and at least based on his drawings, evolved into pictograms over time and organically.
A pictogram is formally defined as a symbol that conveys meaning by approximating the physical appearance of the object it represents. In the case of the ground symbol, it's origin is from a drawing of a grounding plate buried beneath the ground. The vertical line is the wire, the top most horizontal line is the surface of the actual rock-and-dirt ground, and the lower two lines are the top and bottom of a grounding plate.
Here is such a representation, from one of Tesla's patents, dated 1900:
And shortly after, this makes it even more apparent and it is easy to see how the modern ground symbol originated from these drawings:
In that era, patents were a lot like open source is today, in a way. You were given exclusive rights to commercialize the subject of a patent, but this protection was given only in exchange for making how your invention worked available to anyone. Patents were, and still remain, completely public. Considering Nikola Tesla drew the first schematics, has a patent on several fundamental circuit components (like capacitors, or condensers as they used to be called) and, as a consequence, his drawings were made available to and were built upon by his peers of the time. Marconi adopted the ground plate semi-symbol, as did others. Given how closely knit and small the world of electrical technology was then, it makes perfect sense that the depictions used in patents would turn into shorthand for recognized concepts, and ultimately, pictrographic icons we know and love today.
Which is why, if you look at one of Tesla's early patent drawings, you can immediately recognize what everything is, because it is those very drawings that ultimately evolved into the symbols used throughout circuit diagrams today.