# Confusion in regression concept

The probabilistic/statistical formulation of linear regression mean of y is assumed to be linearly related to x with a Gaussian zero mean error. Then we train to learn the parameters w that maximize the likelihood function p(y|x,w). But I don't understand why we learn probability of y, when we need to predict a value of y given x? We are not calculating the probabilities of every possible values o f y and then predicting the one with maximum probability. So how the prediction works after training?

Please note: I am looking for an theoretical understanding, not some library function that do the regression.