First we need to define “generalize”. It means that the neurons have the same response to different but related inputs.
How are the inputs related to each other?
Inputs can be related by being the same input with small variations. The spatial pooler can generalize over inputs which are corrupted by random noise.
The inputs can be related to each other by being adjacent in time, aka they’re elements of a sequence. I’ve previously posted about how the SP can be modified to generalize over sequences by using a low-pass-filter.
Inputs can be related by abstract concepts, and it is not understood how that works. For example: apples and oranges are both edible.