Generally what's in the file takes priority, *however* unless the the file is in a monitored folder, you would need to rescan it before the value in the database will be updated.
Also note that unless you activate "store ratings in the music file" in Tag Preferences, MusicBee does not automatically save the ratings to the file.