A programmer or agent can enter small pieces of code and inspect the results immediately. Many implementations retain variables and other session state, allowing later inputs to build on earlier work.
This supports exploration and incremental calculations. Retained state can also affect later results, so a session reset or a fresh process may be needed to reproduce an experiment clearly.
ELI5
Think of a programming notebook where you try one instruction, see the answer and decide what to try next.
For example, you could store a list of spreadsheet values, calculate their total and then reuse the same list for another calculation.
What does the loop repeat?
It repeatedly accepts input, evaluates it and displays the result before accepting more input.
Does session state always survive a restart?
No. Keeping variables during a session does not guarantee that they survive closing or resetting it.

