It’s a pretty well understood psychological system of variable rewards.
It’s the same reason people open up Facebook or Reddit or Hacker News every day: you don’t know what interesting content you’ll see and that keeps you coming back.
Except games aren’t social network filled with user generated content. Developers make the content (items, skins etc) and have figured out that presenting in a randomised way drives better engagement.