First off, let's collectively understand that every artist is different. Every song is different. Every instrument is different. There is no one set "perfect mix". This is why you can't successfully have a machine do your mixing for you. Mixing a song is very much an art, not a science. As a mixer, my goal is to make your music pop and sparkle. I achieve this with a variety of techniques and tools including EQ, compression, reverb, delay, harmonic exciters, stereo imaging, and more. I only use what your music needs to shine; I won't detract from your sound.
Mastering adds beauty, depth, and presence to a mix. No song is complete before it's mastered to some degree (even if it's being used as a demo). But to be perfectly clear, mastering can't fix a bad mix or recording. If the mix sounds bad, so will the master. Mastering does, however, make every song sound the best it can; making them sound just like your mix, only more full and rich.