A substitution cipher swaps every letter for a different one — but it never changes how often each letter is used. The counts survive the scramble.
English leans hard on a few letters: E is the most common (~13%), then T, A, O, I, N. So in a coded message the tallest bar is almost always E, and the next is usually T.
Line the coded letters up against English's frequency profile and the message decodes itself. The scholar al-Kindi wrote this down around the year 850 — the first codebreaking manual we know of.
That is why a simple substitution is no real security: the statistics of the language quietly leak the key.
Something in the simulation stopped unexpectedly — the lesson continues without it. Nothing you did was wrong; you can move on.