This (or something similar) happens to me all the time.
I believe i know the solution.
When I’m on the Spotify PC app, if i am in the middle of playing a song, and then I plug in a pair of headphones or speakers, or unplug a pair and plug it back in or plug in another set, Spotify will do this. I believe its a bug. Just close spotify and open it again.
Then try to remember to have it PAUSED next time you unplug or plug in speakers or headphones.
If you are not on PC or haven’t messed with your speakers, then I dunno the problem, and I apologize