WebMD has an interesting article on heartburn that states1
With gravity's help, a muscular valve called the lower esophageal sphincter, or LES, keeps stomach acid in the stomach. The LES is located where the esophagus meets the stomach -- below the rib cage and slightly left of center. Normally it opens to allow food into the stomach or to permit belching, then closes again. But if the LES opens too often or does not close tight enough, stomach acid can reflux, or seep, into the esophagus and cause the burning sensation.
This would seem to be something of a union of both theories of heartburn. I was slightly doubtful - the article doesn't cite a particular source - but I was able to do a bit of digging on my own and found a few papers and other reliable sources that support this.
It appears the dysfunction of the LES/LOS is considered to be a cause of heartburn, specifically causing GORD, which then leads to heartburn.
I'd like to emphasize that heartburn generally isn't a standalone illness, but a symptom of something else, just like a sore throat may be a symptom of, say, strep throat. This isn't always the case, but it generally is the case for instances of persistent heartburn.
1 The Mayo Clinic also has a rather accessible article for anyone who doesn't want to trudge through scientific papers.