While Emacs can run in a terminal, it is more widely used as a GUI application that can render images, PDFs, variable-pitch fonts, handle mouse support (drag-and-drop, menus, scrollbars), and even work on touchscreens such as on Android [1].
You are right that VS Code has a "nicer" out of the box UX (this is subjective of course), but Emacs offers a malleable environment. In VS Code, you are limited to what the APIs the developers decided to expose. If you want a specific behavior that isn't supported, you either fork the editor or create a feature request ticket and wait for someone to prioritize it. In Emacs, because you have full access to the internal runtime, you can implement that feature yourself in a couple of lines of Lisp.
1: https://kristofferbalintona.me/posts/202505291438/