Correlation is a metric which measures the relation between random data samples. It is originally defined for random processes as $\rho_{XY}=\frac{E[(X_-\mu_x)(Y-\mu_Y)]}{\sigma_x\sigma_y}$
Whereas linear equation is given in such a form: $f(x)=ax+b$ which is in principe deterministic.
The idea is that if there is a correlation between two random variables $X$ and $Y$, $X$ will look like similar to $Y$ as much as the degree of the correlation. For example of $\rho_{X,Y}=1$ then $X$ and $Y$ will be perfectly correlated. This means $X$ and $Y$ will output the same samples $x$ and $y$. Now lets have a look at the linear equation for this specific case. Obviously we will have $f(x)=x$. If we have for example $X/2$ and $Y$ for which we have $\rho_{X/2,Y}=1$ then we will have $f(x)=x/2$. In general we can have the form $f(x)=ax+b$ if we are talking about a very correlated data. In case the data looses the correlation then it will spread around the line $f(x)=ax+b$ for some suitable parameters $a$ and $b$.