A linear predictor can output any real number, but a mean often cannot be any real number: probabilities live between 0 and 1, counts must be positive. The link function bridges the two, mapping the mean onto the unbounded scale where the model is linear; its inverse maps model outputs back onto the outcome’s scale.
Each exponential-family distribution comes with a canonical link derived from its own algebra rather than chosen by convention: the logit for the Bernoulli, the log for the Poisson, the identity for the Gaussian. Canonical links also keep fitting well behaved, which is why they are the defaults in most software.
