Notebooks exist because data work is exploratory: you look, adjust and look again.
A script runs from top to bottom in one go, while a notebook lets you stop and inspect after every step.
The name comes from Julia, Python and R, the three languages the project first aimed at.
Behind each notebook runs a kernel, the process that executes the code and holds the variables.
Running a cell sends its code to the kernel, and the result comes back into the page.
Text cells use simple formatting, so explanations and headings sit next to the code they describe.
The notebook file saves the code, the text and the latest outputs together.
That makes it easy to share an analysis with its charts included, without the reader running anything.
The kernel's memory is not saved, so reopening a notebook shows old outputs but no live variables.
Hidden state is the main danger, because a cell edited or deleted after running can leave results nobody can recreate.
Restarting the kernel and running every cell from the top is the standard check before sharing.
Notebooks are awkward to compare line by line between versions, because outputs change on every run.
Analysts usually explore in a notebook, then move code that must run on a schedule into plain scripts.
They are widely used for teaching, because each step and its output can be read in order.
A notebook is less a program than a lab record of what was tried, and it should be read that way.