They only store a catalog of the most popular songs. (Where 'most popular' is determined by your geographical location). This catalog is periodically updated.
I think the Pareto principal kicks in hard here. If it stores the top 20,000 songs as the other comments suggest then I expect that would include the vast majority of music you’d come across.