monkeydelarge: What makes flac and ape different from mp3s?
Both flac and ape are lossless compression algorithms, meaning no quality is lost on compression and decompression, unlike mp3 which is usually used as a lossy format.
monkeydelarge: Which format is best for music and why?
If your original audio is of high quality, flac and/or ape will preserve said quality. If your original audio is a phone recording of a concert, there isn't really that much of a quality to preserve.
Compare music encoded in both, if you can hear a difference, pick the one that sounds better. If you can't hear a difference, mp3 offers smaller file sizes.
The_Shape: If you have good brand speakers you will hear the difference.
Good ears and good original audio is also needed. Flac encoding a shitty recording will still result in a shitty recording.