Smartphones can record better today, but a professional song still requires the right microphones, acoustic spaces and audio processing.
Many artists will record ideas on their phone and then finish up the song in a recording studio.
The audio quality can be improved by professional mixing and mastering, but you will get the best results if you start out with a good recording.