The "UNIX Programmer's Manual" [1] by Ken Thompson and Dennis Ritchie says this:
Commands are programs intended to be invoked directly by the user, in
contradistinction to subroutines, which are intended to be called by the
user’s programs. Commands generally reside in directory /bin (for binary
programs).
How do you decide whether a program should be made into a command and run at the shell versus made into a subroutine that is called by other programs?
[1] https://www.bell-labs.com/usr/dmr/www/manintro.pdf, page ii.