Is there a difference in how Gas is produced which determines if it becomes a burp or flatulence?
The gas expelled as a burp originates from the stomach. It is either gas swallowed together with food or gas that was dissolved in the drink. One prominent example for the latter is sparkling water where $\ce{CO2}$ is dissolved in the water at high concentration as carbonic acid ($\ce{H2CO3}$). Because of the acidic environment in the stomach the equilibrium between carbonic acid and $\ce{CO2}$ gas is shifted. Consequently $\ce{CO2}$ accumulates and needs to be expelled as a burp.

The gas expelled as a fart is mainly produced by microorganisms in the intestine and usually contains a lot of methane which makes it flammable.