In statistical mechanics, the correlation function is a measure of the order in a system, as characterized by a mathematical correlation function. Correlation functions describe how microscopic variables, such as spin and density, at different positions are related. More specifically, correlation functions measure quantitatively the extent to which microscopic variables fluctuate together, on average, across space and/or time. Keep in mind that correlation doesn’t automatically equate to causation. So, even if there’s a non-zero correlation between two points in space or time, it doesn’t mean there is a direct causal link between them. Sometimes, a correlation can exist without any causal relationship. This could be purely coincidental or due to other underlying factors, known as confounding variables, which cause both points to covary (statistically).
A classic example of spatial correlation can be seen in ferromagnetic and antiferromagnetic materials. In these materials, atomic spins tend to align in parallel and antiparallel configurations with their adjacent counterparts, respectively. The figure on the right visually represents this spatial correlation between spins in such materials.