A built prefix function is not a search result. It does not say where a string occurs in a text. It only describes the pattern’s internal self-overlap: which beginnings of the pattern reappear as endings of its own prefixes.
That is exactly the information needed by the Knuth–Morris–Pratt algorithm. When a match attempt fails, KMP asks: “How much of the pattern’s beginning have I already seen at the end of what matched?” The prefix function answers that question without looking backwards in the text.
The table is about the pattern alone
For
Each entry
So
has longest proper border
The value says what survives a mismatch
Suppose a search has matched
But the suffix
This is the important shift in viewpoint:
One entry can hide a whole chain
The value
For
These are not random jumps. They are the possible border lengths of the already matched prefix, tried from longest to shortest.
So the built prefix function is a map of possible recoveries. It tells KMP: if the current guess is too long, which shorter guess is still consistent with the characters already seen?
What to remember
The prefix function tells you how the pattern can restart inside itself.
It turns a failed comparison from “start over” into “keep the longest part that is still justified”. That is why KMP can move through the text without backtracking: the text scan supplies the characters, and the prefix table supplies the safe fallback lengths.