Not necessarily. Tim Sweeney owns more than half of Epic Games, and (presumably, I'm obviously not privy to what contracts he has signed) has no obligation to sell for any amount of money. He is also rich enough to have "fuck the world money" and not accept a price that is far above what his share in Epic Games is actually worth.
That would be a stupid strategy for Apple, for a multitude of reasons:
1. Fighting it out in court, and then paying damages is probably going to be cheaper than 18 billion USD.
2. I don’t know if AppStore profits (NPV of discounted future profits) make it even worth 18 billion USD.
3. If they buy out Epic, they’re signaling weakness which is basically asking the next company to play the same game.
4. It just provides more evidence & impetus for those pushing for antitrust action.
There is technically a chance Apple might eventually acquire Epic, but if so, that would be driven by Apple seeking an interesting platform for its VR hardware, not to just close down this lawsuit.