And selling hardware. Software aside, both POWER and s390x have a niche and are legitimately competitive in terms of performance (although cost is another matter).
Because they're raking in huge bucks supporting legacy software and doing services/consulting work. They also turn Red Hat products into IBM revenue through bundling/repackaging it
IBM largely makes their money supporting legacy software, doing services and consulting work, and through Red Hat's software offerings