Quick reply...
When you insert a CD, the album and track info is looked up by MC. It will first look in its own database YADB, and then FreeDB (with MC15 or later). Then the CD is remembered by MC, in its internal CD database.
Ripped tracks then inherit the data found, and perhaps subsequently entered/edited by you. Cover art will then be looked up in YADB. If found, it will download the current "best" choice. If not, you can scan/upload to store/share it.
The file format (FLAC, etc.) is not really relevant.
Most prefer a compressed lossless format over wave. How about APE of FLAC instead?