Both tools reduce the file size of the gdb.
Compress reduces the space that the gdb (or single feature classes) needs on the hard drive. This is done by saving the table/gdb in a different (smaller), read-only format.
Compact defragmentizes the gdb. While that can change the size of the gdb, this change is due to the gdb using the space on the hard drive more efficiently, not any actual reduction of size.
Equivalents in your operating systems (in purpose, not in implementation) would be:
- Compress: generating a zip file
- Compact: defragmenting your hard drive
You should use Compact from time to time, especially if you do lots of work in the gdb. Not only does it reduce file size, but it should also make reading and writing somewhat faster. EDIT: This is only useful for HDDs. SSDs don't get faster when you defragment them.
Compress seems like a relic from a time when file size mattered much more. It's a way to archive a gdb when you don't need to write to it anymore. It can reduce the size of the gdb by huge amounts, but disc space is cheap now, so you don't neccessarily need this tool.
Have a great day!
Johannes