I have come across this term numerous times and this expression is well used when something unbelievable or shocking happens but I don't understand how Mother of God can imply its meaning. Does refer back to the Bible (or any religious book) or mythological event? How is its very meaning originated?
It refers to Maria of the Christian bible. - As Andrew mentions, it was largely used by the Irish or people who mock or pretend or play an Irish person
It is similar to saying "Jesus!" but may be less provocative, I guess, to Catholics, who have a thing about taking the name of the lord in vain - another expression for you
Nowadays this is (largely) simply an exclamation, but originally it would certainly have been invoking the Virgin Mary, one of whose titles is Mother of God. Catholics invoke the prayers of the saints, and this is what this expression seeks — or originally sought — to do. [This site isn't the place for a discussion on the doctrine of the Theotokos, though.]
There are a few similar phrases still in use: Gosh and Cor are euphemisms for God; Cor blimey does mean "God blind me [for seeing that]". The obsolete zounds was euphemistically substituted for the oath "By God's wounds".
Use of a Catholic phrase such as "Mother of God," "Holy Mother of God" or even "Sweet Jesus" is naturally more prevalent in Catholic countries. Its use in the United States might be explained by the levels of Irish immigration. The phrase has had a couple of hundred years to divest itself of its overt "arrow prayer" nature.