Confusion about finite automata construction in Knuth–Morris–Pratt algorithm
Say we are at state j (in the question's example, j is 5). This means that so far we have successfully matched j characters (characters 0 to j-1 of the pattern). Now, we receive a new character - call it newChar. 

Case 1: newChar is the character we wanted ('C' in the example). All is good and we have now a match of j+1 characters (characters 0 to j of the pattern).

Case 2: newChar is not the character we wanted. Let's assume the most optimistic situation: that we've now matched j characters of our pattern. (We couldn't have a match of j+1 characters in this case, because otherwise we would be in Case 1.) The last of these j characters that we matched is newChar. To have a total of j characters matched, then, we must have matched characters 1 to j-1 of the pattern plus newChar.

Because a mismatch puts us in Case 2, and Case 2 only uses characters 1 to j-1, we need only run the simulation using the last j-1 characters.