A customer recently changed over from using a POP3 mailbox to IMAP, so everything would sync nocely across his devices, everything was hunky dory for a few weeks and then suddenly out if the blue he was missing a load of emails from his iPhone yet they existed on his Mac Mail. Now remember this is IMAP, not POP3 so it should all be synchronized, right. Wrong!
As it turns out most the iPhone will show you the emails in the order they were last modified. Yes, last modified. Not received, but modified. There's a relatively quick fix for that! Select a chunk of the oldest emails and mark them as unread then mark them as read, move up the list of emails a bit and do the same for a chunk of newer emails and so on until you've done them all. Doing this, in this order will give the older emails an older modified time of the newer emails, making them display correctly on the iPhone.
In my testing I found that Android has many more options than iOS and that a work around on my Galaxy S3 was to show all emails for that account. Unfortunately there is no workaround on iOS, at least that I know of..