In a stored program computer, instructions are just words in memory, and STORE can write any word. So a program can overwrite one of its own instructions before the PC reaches it. That's self-modifying code.
When the PC gets to the changed word, the CPU fetches the new value and runs it. The CPU has no idea the word was changed; it just executes whatever is there.
Early computers used this on purpose, for example to step an address field through an array. Today it's mostly avoided: it makes programs hard to understand and debug, and modern CPUs with separate instruction caches have to do extra work to notice the change.
For tracing, the lesson is simple: always use the current contents of memory, not the original listing, when the PC reaches a word that an earlier STORE wrote to.