The kernel doesn’t know anything about the notebook document: it just gets sent cells of code to execute when the user runs them.
See Jupyter kernel (Programming Languages).