Who knows why it works for some? Maybe it's the combination of acids and bacteria, maybe it's psychological, maybe a little of both...but it worked. Snopes even said it's a false urban legend but I'm not so sure about that.
A few years ago I heard about the "maternity salad" from a restaurant in Los Angeles. There were testimonials from pregnant women who would order the salad and go into labor hours later. Word got around. The owner bottled the dressing and sells it on the internet.
It's a basil, balsamic vinaigrette dressing with romaine lettuce and gorgonzola cheese. I mentioned it to my friend and she bought it for fun. At week 40 she was 3cm dialated and made the salad two nights in a row. The first night the plug came out. The next night her water broke.