The origins of shallow gas