You could think of Emacs as a mix between an integrated program suite (like Lotus Symphony, Ashton-Tate’s Framework or AppleWorks) and a Lisp Machine.
Like an integrated program suite, you can move from program to program (Emacs modes), copying your data around easily, and using similar (or the same) commands and user interface for every program/mode, making data manipulation in many ways simple and fast.
Like a Lisp Machine, Emacs is totally user programmable at every level, making both debugging easy when/if something breaks, and extensible with your own programs, ranging from simple keybindings, or macros, to full major modes. (Most major modes in Emacs started out as a single person’s personal customizations.)
> Like a Lisp Machine, Emacs is totally user programmable at every level
It's just that the levels of GNU Emacs don't get as low-level as the Lisp operating system of Lisp Machine (which is an actual computer with its operating system, and not an programmable editor written on top of operating systems, which were written in C and a bunch of other languages). The levels of a Lisp Machines go all the way down to (for example) the network stack and the actual instructions interfacing with the hardware. GNU Emacs usually re-packages the underlying OS services (I/O, file system, GUI, ...) with a Lisp-based API and one programs with that.
Well, yes, because GNU Emacs runs on Unix-compatible systems, and Emacs uses the Unix API to do its thing. For instance, Emacs does not implement TCP itself, it uses the Unix TCP/IP stack.
It also on Linux/UNIX does not create a directory listing itself, but calls an external program, provided by the operating system: ls. Where on a Lisp Machine it calls the Lisp function FS:DIRECTORY-LIST, which underneath is implemented in Lisp via its object system.
On a Unix-compatible system, ls(1) is the highest-level interface to get a directory listing. There is no good reason for Emacs to use scandir(3) (or even opendir(3)/readdir(3)).
GNU Emacs has complex code to deal with it. Some "ls" programs support a "-dired" option, some not. If this option is not supported, then Dired may fail to parse some unusual filenames. Then there is an 'ls' emulation in Emacs Lisp, which by default is not used on UNIX, but on Windows...
There is a huge machinery with lots of complexity to deal with listing directories, either with ls, a GNU provided ls, or by providing a complex emulation of ls.