The law of proximity is the tendency for objects that are close together to be perceived as related. The law of proximity is one of the Gestalt laws of grouping, which are a set of principles describing how the human brain organizes information.
The brain is thought to group together objects that are close together in order to make sense of them.
For example, if you see a picture of a dog and a cat next to each other, you are more likely to think of them as friends than if you saw the same picture with the dog and cat far apart.