Yes, motivated by money.
"can you imagine when you first install your phone they ask which store app do you want to download?" - Kirby
These aren't the same situations. Apple makes both the hardware and the software (the OS), so it's all their product. On the other hand, both Google and Microsoft are OS providers who tried to force their software regardless of which hardware the consumer bought. If software providers wanted to have the same control as Apple, they would have to make their own hardware. But that is hard, so they don't do it (anymore).
And if Epic were truly against royalty fees, they wouldn't charge them on their own store. Why do you think they do that?