Each time you delete a message in Windows Mail it leaves an empty spot in the database (index). Compaction removes the empty spaces, thereby speeding up database access.
Windows Mail is offering to compact the index file for email messages, to remove the references to deleted messages, and will keep doing so until you let it do this.
The actual messages are stored in separate files and are not affected by compaction.
If you say yes to the message the compaction message will disappear until you close Windows Mail a certain number of times - usually 100 times.
You should let Windows Mail do the compaction, you will not lose any of your messages.
If you do not want compaction to occur you can turn it off
Open Windows Mail > Tools > Options > Advanced > Maintenance. UN-check the compact option > OK