Both do - it detects, from current file and position, which namespace it is, and then sends a (in-ns 'namespace.name) before the eval
The detection is basically: search for top-forms that happen before the current file's position to find a ns form. If it doesn't find anything, search for something below it. This second check is basically to solve a weird edge-cases that happens when you try to eval ns forms with metadata on it (for example, because of clj-kondo config)
I think CIDER does something similar
Aha. Interesting! I have wondered, idly, how the running process matches the text file when sending specific forms… (and I have a larger question looming about why you have to keep the actual “content” of the process in your head, but that’s a different thing).