This article describes how MessageStats calculates the license consumption.
When a MessageStats gathering task runs, it searches for physically created mailboxes on all Exchange Servers. It does not count mailboxes that were not yet physically created on a mailbox store level, though a corresponding Active Directory mailbox enabled account was created.
To clarify, when you create Active Directory mailbox enabled account, an Exchange Server does not create its mailbox right away. The actual mailbox will be created either when someone sends an email to this mailbox or someone logs into that mailbox for the first time. MessageStats counts only physically created mailboxes.