The songs that you listen on Spotify are co related with the singer, so Spotify assumes that you like the singer and then plays songs according to it. There are more than 5 factors according to which the also is working, after all it is not random.