Linear mixed effects models can be estimated using different techniques. The lmer function uses penalized weighted-least squares. A very detailed discussion on the algorithm can be found at https://cran.r-project.org/web/packages/lme4/vignettes/Theory.pdf.