This is the law of similarity. This is a heuristic that the brain uses to group things together that seem to be the same, but might have subtle differences. We tend to not be able to see those differences as easily, and our brains tend to group the objects together that have higher-level similarities (color, shape, size) and see them as a single object.