Pork & Sauerkraut

I have seen recipes for Port & Sauerkraut that calls for beer. What is the purpose of adding this? I do know that adding an apple or applesauce helps with the intestinal gas issue but beer?

Thanks,
Cam