It's both. A lot of surgeons will 'inflate' the intestines with air to check for leaks, like you would when changing the inner tube of a tyre, so that causes internal wind. If you have laporoscopic surgery your abdomen cavity is inflated to allow for better vision and movement, so you get air pockets left behind which can travel up to your chest and back.
Best way to get rid of both types is movement. After that, you can try remedies like windeze, gripe water etc, or traditional ones like mint tea.