In some instances, I have purchased FLAC downloads of some of the same albums that I have ripped. In most cases there are minimal if any differences in sound quality between the AIFF files and the higher resolution FLAC files. When there are differences in sound quality, it appears to be due to the source being remastered versions of older albums.
Yes, different mastering is usually the biggest difference.
On sites like Amazon Music you can compare different masterings, and hardly any of them sound the same.
What bothers me is that some of them can initially sound better on less ambitious speaker systems, and then worse on more revealing full scale ones.
I spent some time comparing the remastered Beach Boys 1993 Good Vibrations box set with their remastered 1999 Greatest Hits, Vol. 1: 20 Good Vibrations after reading about both on the Steve Hoffman music forum.
The former sounded better on the better system.
Listening to them on headphones was something different yet again.
Without a reliable reference source of material (or playback equipment), it is tricky to come to any worthwhile lasting conclusions.
In comparison, the difference in bitrate is usually insignificant.