It's knows not be true random "It doesn’t like songs that are totally different bumping up against one another" and users wouldn't like if the same song is played twice in a row regardless how logical that would be with rand().
https://lifehacker.com/the-reason-spotify-shuffles-aren-t-re...
https://medium.com/immensity/how-spotifys-shuffle-algorithm-...