You''re kind of asking the wrong question here, because any half-decent modern mastering suite does something that's somehow neither and both of the above, at the same time. Plus if you get one with a LUFS meter & true peak, you don't have to worry about your output, it becomes almost set & forget. All you have to listen for is noticeable crushing.
Here's my usual rig, IZotope Ozone, which is pretty 'smart' at setting up a decent first guess at a mastering process - it's not actually intelligent, so it can make some drastic errors if your input track is truly horrible, but otherwise it really leaves you to just do some final gentle tweaks.
Click any for full size
This is how it 'guesses'…

It then dials in some EQ & also some dynamic EQ, which is like a multiband compressor. It's not really doing much here because there's nothing wrong with the track.
If it thinks your mix is really horrible, it will also add in some more aggressive compression - here switched off.
This is what 40 years of mixing experience gets you;))

Then comes your 'smart' limiter. These days they don't just hammer the life out of the peaks, they're much 'smarter'. This also lets you set up your optimum output levels independent of actual limiting/compression.

And, just to check how it's all looking for download vs streaming, you do a final check with this lovely bit of kit - Youlean Loudness Meter [available in free & pro versions] to check your LUFS levels. You can go all out for CD loudness, or like here, kind of split the difference between that & streaming levels. I find if I stay below -10 or so, it still sounds OK for file/CD playback & isn't murdered by the streamers, who all have their own, different ways of messing up your sound.

This track is actually a 'pop' song, so it has less of an overall dynamic range than some tracks, though as it's a bit of a boy-band type ballad, it does have some light & shade, building towards the end. Even so, I didn't want it banging the meters hard right the way through. All these screenshots are from the outro chorus, the loudest bit.