A random effect gives a group its own coefficient without spending a free parameter on it: the group offsets are modeled as draws from a common distribution, usually a zero-mean Gaussian, and what the model actually estimates is that distribution’s variance. A random intercept lets groups differ in baseline; a random slope lets them differ in how strongly a predictor acts.
Because the offsets share a distribution, each group’s predicted effect is shrunk toward zero deviation by an amount that depends on its sample size, which is what distinguishes random effects from per-group dummy variables and makes them usable even for groups with a handful of observations.
