A string border is a proper prefix that is also a suffix. Borders let a matcher reuse work after a mismatch. If a candidate border fails to extend, try the border of that border instead of comparing the text again from the beginning. The prefix-function table records these fallback lengths.
Overlapping matches make the fallback rule visible. After matching aba inside ababa, the final a can begin the next match. Resetting the matched length to zero would lose that occurrence. Palindrome construction uses the same border table on a string joined to its reverse with a separator absent from the input alphabet.
Not every string problem needs that table. Expanding around centers is a clear quadratic solution for the bounded palindrome-span task. Restricted expression matching instead uses two-prefix dynamic programming. State each grammar precisely: its star repeats the preceding atom, unlike the standalone wildcard star in the mixed practice set.