M4A wraps AAC audio, the codec Apple built its ecosystem on and the one YouTube and most streaming services use. AAC is simply a more modern design than MP3: at any given bitrate it holds onto more detail, and the gap is most obvious at lower bitrates where MP3 starts to sound brittle.
Choose M4A for iPhone, iPad, Mac and the Music app. Choose MP3 when a car stereo, a gym device, or a decade-old piece of hardware has to play it.
M4A or MP3?
At 128 kbps the difference is easy to hear — AAC keeps cymbals and vocal sibilance clean where MP3 smears them. By 256 kbps both are transparent to almost everyone. So the real question is compatibility, not quality: MP3 plays on literally everything, while M4A plays on everything made in roughly the last fifteen years. If the destination is an Apple device, M4A at 192 kbps gives you a smaller, better-sounding file.