On MS-Windows and MS-DOS systems, and also on some remote systems, Emacs emulates ls. See Emulation of ls on MS-Windows, for options and peculiarities of this emulation.
https://www.gnu.org/software/emacs/manual/html_node/emacs/Di...
https://www.gnu.org/software/emacs/manual/html_node/emacs/ls...
- shelling out to an unreliable program and doing all the parsing work;
- adding a special mode for yourself to another piece of software, which may or may not be present;
- adding a user customization point;
- adding an emulation of said software when it's not present;
when you are in a real programming language, and all you need to get the clean data directly is readdir(3) and stat(3) (or their Windows equivalents)? This is unbelievable.
dired will use `ls' if it is available. You can also control the arguments passed to `ls' if you want to customize sort order and suchlike. You cannot trivially do this if it's hardcoded as syscalls.
Emacs's buffer concept specifically works around the idea of annotating the output of common coreutils commands and annotating them so they are interactive in Emacs. That means you can combine `find' + `ls' and show a collated list of files matching the things you want. That is very powerful.
Oh, and you can swap out `find' or `ls' with anything that emits a similar format (or customize Emacs to interpret it differently).
Now your readdir, stat, etc. equivalents require significant development effort.
Emacs dired works fine on other platforms, which don’t have GNU ls on them, so I’m guessing by default it doesn’t run ls on its own.