It depends on the app that you use. M3u is pure playlist. Just a channels and logos. No EPG. Some apps know to take username/password from m3u and fetch the EPG from xtc (if it exists). Most of the app support XTC Api login, and together with that, the EPG.
So i would say that Api connection should be your choice number 1. But again, depends on the app you use (and your provider's EPG).
It's just a different way of accessing the content. With xtream codes it's technically easier as you just need to put your credential once. For m3u you need to add EPG URL separately, though many apps can do it automatically as well since it's just a matter of changing one parameter in the URL.