Depends what program is giving the prompt. The window is merely a terminal window. There are many programs that write to console. If you start a dos program then it becomes Dos which doesn't support long file names.
It's much more complex than what I say, but that's the gist of it.
What you see is merely a console. If a Dos program exits then command.com provides the prompt. If a console program exits then a/ if started from the GUI the window closes (as there is nothing to provide the prompt) b/ if started from a 32 bit command prompt then cmd provides the prompt, c/ if started from command.com then command provides the prompt, and d/ Dos programs, no matter how started, always load command and command loads the program, then depending on settings - the window closes (because command exits as well) or command provides the prompt. 16 bit Windows programs are loaded similar to Dos programs but command always exits with the GUI program (and as there is no console window you don't see anything).
Command passes all internal command typed to cmd for execution.