The Unreal Engine license is like Epic giving you a toolbox for no upfront cost, but charging you 5% of whatever revenue you generate selling goods made using the toolbox.
The App store comission is like Apple charging you 30% anytime you sell one of those goods to someone who lives in an Apple branded house. (To complete the analogy, maybe you're a door to door salesman and Apple charges you a "sidewalk usage fee" or something)
One (Unreal Engine) is a licensing agreement for a tool with no upfront cost; the other is a tax on any sale made to an end user.