Depending on what email program or service you use, deleted emails may or may not be really deleted. It’s surprisingly hard to tell for certain.
Compacting should be completely transparent. It makes files smaller and potentially makes access of email a little faster. There is one dramatic exception.