What causes gas in your stomach?

Air pockets and eating the wrong food either too late at night or too early.