Suppose you construct a probabilistic model, where $y_i$ are believed to be related to your $x_i$ under the formula;
$$ y_i = w_1 x_i + w_0 + \epsilon_i $$
So $w_1$ and $w_0$ are your target parameters from before and $\epsilon_i$ is an error term which you expect follows some probability distibution, e.g. $\mathcal{N}(0,\sigma^2)$. It is important that its expectation is zero.
Given your data you want to maximise the probability of returning every $y_i$ given your data $x_i$ subject to your model. The probability of getting $y_i$ from $x_i$ is equal to $f_{\epsilon}(y_i-w_1x_i-w_0)$, where $f_{\epsilon}$ is the probability density function of $\epsilon$, i.e. a normal distribution.
And the likelihood of getting every $y_i$ is the product of them all,
$$ L = \prod_i f_{\epsilon}(y_i-w_1x_i-w_0) $$
You want to maximise this value by tweaking $w_1$ and $w_0$, hence the name maximimum likelihood estimation.
Note that this is equivalent to maximising the log likelihood, so;
$$ \log L = \sum_i \log f_{\epsilon}(y_i-w_1x_i-w_0)$$
And if you look at the normal distribution density function you will see that (after ignoring some constants) this reduces to the problem of maximising..
$$ - \sum_i (y_i-w_1x_i-w_0)^2 $$
or in other words minimising the sum of squares akin to OLS.
But like using a different distance function in OLS you can parametrise a different error distribution in MLE.