I don't own a Glock, and this doesn't answer your question as to WHY they are reliable, but it is one example of their reliability.
In one issue of the Shooting Times, a gunwriter was testing a Glock through 10,000 rounds. He dropped it in mud with the barrel taped and chamber empty. He then quickly wiped it off, and shot it with mud slinging everywhere, no malfunctions. He then covered it in sand with the barrel taped and chamber empty. He shot it with no malfunctions. He put it in a plastic bag (chamber empty) put the plastic bag in a milk jug of water, and froze it overnight. He then smashed the ice on the ground, racked the slide, and shot to slide lock, no malfunctions. He parked his one ton pickup on the top of a Glock with a full magazine and an empty chamber. A couple hours later, it fired with no malfunctions. Whenever the gun became hot from extended firing, he would simply lock the slide back and toss it in a pail of water to cool off. No malfunctions throughout 10,000 rounds of 9mm ammunition.
Why are Glocks reliable? I don't know, they just appear to be. Like I stated originally, I don't own a Glock, but if I was going to be in conditions where I wouldn't be able to maintain my handgun, I believe a Glock is what I would choose.