Some ideas behind the sorting.
I think it's interesting how I haven't seen this mechanic widely in other games. There's physical-world analogues in postage collecting and jigsaw puzzle sorting, not to mention all other kinds of collections.
With jigsaw puzzle pieces, the sorting is focused on colors and textures. Finding a different piece is great, since it's easy to locate in the finished puzzle.
As a kid, I had a stamp collection. I remember spending so much time just sorting a mixed bag of stamps into different countries, motifs and such. It was really calming and gave a sense of accomplishment, even though the collection was probably worth next to nothing. The completed album was more of an expression of creativity than a collection of rules. With stamps, each item was also valuable - well, most likely not costing even a cent - and there was information attached, such as the face value, country of origin, and commemmorative texts. When sorting, I would remember that I had seen a similar stamp recently, and then find its sibling. Soon there might be a small family. Even copies of the same stamp were interesting, since those could be arranged by condition and slight differences.
Even before the stamps, I sorted my grandmother's jewelry. She had a box of cheap plastic earrings, necklaces and such. Just looking at them and spreading them out on the floor in neat rows was so much fun. I was generally not a very calm child, but this kept me occupied for a long time. And my mother had a small box of buttons. I liked sorting these out to different piles, based on color and shape.
Both stamps and jigsaw puzzles are basically games we humans have created that employ the pattern-matching abilities we have. There is probably even better examples, but I can't think of any. I think humans have been sorting things for the duration of our existence, be it different sheep or pieces of dried food.