I think you would have to look into the history books for the answer.
Oh my god!
These are expressions
even Holy crap! has a religious word in it.
In the old days everything revolved around religion.
The religious leaders led the populations.
There were times if you didn't "believe" a certain thing you were killed (burned at the stake)
Religious words had, and still do have a shocking connotation. They relate to something shocking.
Usually these expressions are used when someone is shocked about something.
Holy crap! The car is gone. Oh my God!
The reason the young child in the other post is saying Oh God! is because he has said this before. Probably many times before.
Even back to the times when the religious leaders ruled the people.