Apples App Store guidelines (the rules for being accepted into the App Store that developers agree to be bound to via their developer account) says this:
3.1.1 In-App Purchase:
If you want to unlock features or functionality within your app, (by way of example: subscriptions, in-game currencies, game levels, access to premium content, or unlocking a full version), you must use in-app purchase. Apps may not use their own mechanisms to unlock content or functionality, such as license keys, augmented reality markers, QR codes, etc. Apps and their metadata may not include buttons, external links, or other calls to action that direct customers to purchasing mechanisms other than in-app purchase.
Epic Games breached these guidelines in their Fortnite game by enabling a payment mechanism in the IOS Fortnite app which did not use Apples In-App payment system. Their approach in Fortnite did not fall under any of the exclusions Apple allows in 3.1.3 of the above document.
Epic Games could have avoided this conflict by not enabling their own payment mechanism.