Where iTunes stores my playlists and ratings
Actually it stores the original on your computer.

The iCloud just gets a copy of it if you have set it up that way.

You can find the file in the ~/Music/iTunes/iTunes Library.itl

and in the iTunes Music Library.xml (located in same place)

https://support.apple.com/en-us/HT201610