So the method employed by LinearModelFit is a hybrid: It does return a function, FittedModel, but this is an existing function defined externally (and hidden) and is returned with a bunch of info bundled into an Association as its argument:
FittedModel[<|"Type" -> "Linear",
"Model" -> <|"FittedParameters" -> {0.186441, 0.694915},
"IndependentVariables" -> {x}, "BasisFunctions" -> {1, x},
"LinearOffset" -> <|"Function" -> 0, "Values" -> 0|>|>,
"KeyNames" -> Automatic, "Weights" -> <|"ExampleWeights" -> 1.|>,
"InputData" -> {{0, 1}, {1, 0}, {3, 2}, {5, 4}},
"UserDefinedDesignMatrixQ" -> False,
"DesignMatrix" -> {{1., 0.}, {1., 1.}, {1., 3.}, {1., 5.}},
"Localizer" ->
Function[Null, FittedModels`LocalizedBlock[{x}, #1], {HoldAll}],
"Options" -> {}|>]
This bundled info is enough for FittedModel to calculate any of the requested outputs. So FittedModel must be defined using SubValues something like this:
FittedModel[params_]["PValue"]:=...
FittedModel[params_]["ParameterTable"]:=
So I think I am beginning to see how it works! Don't understand the "Localizer" association yet, but little steps...