It's because IMAP is not very good for disconnected or mobile operation, and if you're willing to put a server between the on-device client and the IMAP server you can do much better at the cost of sharing credentials and content with the server. Not a new idea, mobile mail systems going back to Danger, BlackBerry, Good, etc have done this and probably there was precedent before that.
Client authors try but there are still IMAP protocol design choices that cause issues with sync reliability, bandwidth usage, lack of push, etc. You can read the JMAP design rationale for details, they cover it all pretty well. Security issues with middle boxes are well known too, just ask anyone who's worked in IT security how they feel about BlackBerry Enterprise Server. I think it's possible to build something similar in a better way by isolating the middle box bit and putting it in a more controlled environment like AWS Nitro where the client gets boot attestation and the service provider sees only a black box they can bill for, but this would require getting Apple etc on board to modify their clients.