iCloud mail is IMAP, so it behaves as I described. However it's possible to download the messages if you want to, though on a Mac you have to specifically choose this.
If you can still see the messages when offline then that certainlhy suggests the phone is downloading, or at least cacheing them. Do you still see older messages (that you haven't access recently) when offline? You may be able to clear the cacheL: but not having an iPhone I can't advise on that. You could ask in the forum for iPhones - the IMAP behaviour isn'tn confined to iCloud but is an industry standard and many other services behave the same, so it's the behaviour of the Apple Mail app you would be asking about.