What causes a "stitch" in your side?

I used to get these when I was a kid. We’d be walking to the store or whatever and I’d get a sharp pain in my side, clearly caused somehow by the exertion or thirst, etc. My dad was very familiar with it, said I had a “stitch” in my side, and told me to walk it off – his solution for most things.

link

Apparently it’s either a cramp in the diaphragm or the stomach and liver pulling on your diaphragm.

I’m not sure precisely which muscles, but I thought those were muscle cramps somewhere in your torso… too much activity, too little oxygen, and a buildup of whatever nasty acid it is that comes out of anaerobic exercise.