Oversupply can cause gas because the baby ends up getting more foremilk and less hindmilk than they should. (foremilk and hindmilk are oversimplifications, but that doesn't matter here). The hindmilk is higher in fat. When baby fills up entirely on lower fat foremilk, they are getting too many of their calories from lactose, so they can get gassy. I guess even a baby's digestive tract can only handle so much lactose.