# How does R compute lmer() and glmer() from lme4?

I have another question regarding the lmer() and glmer() functions from the lme4 package.

Consider three models

lmer1 <- lmer(y ~ 1 + (1 | group.indicator), data=data)
glmer1 <- glmer(y ~ 1 + (1 | group.indicator), data=data, family=binomial(link="logit"))
glmer2 <- glmer(y ~ 1 + (1 | group.indicator), data=data, family=binomial(link="logit"), nAGQ=0)


Each model shall fit the given data without predictors. To be estimated is the intercept in each group. (The given data may vary between each model)

What method is used by R to fit each model and how is it computed? My goal is to fully understand these models. I want to be able to fit the models manually, if necessary.

The description of 'Package ‘lme4’' doesn't tell too much about explicit calculations.