The law of proximity is a Gestalt principle that describes how people perceive elements closer together as more related than apart. It reduces cognitive load so users don't get overwhelmed by all the information.
It's a best practice to apply this principle on groups of data fields to create multiple sections on a form. However, not many designers know you can take it one step further and use it to create pairs of form fields.
Instead of grouping them, you'd conjoin them so they become a sibling field. For example, first and last name data have a strong relationship. You'd never ask for one without the other or break them apart in the field order. In other words, they're siblings that always belong together.