Firstly, some background. DOS uses 21h interrupt for its system calls. AH is used to demultiplex various INT 21h functions. When a program is executed, DOS sets 256 bytes in front of it, known as PSP (program segment prefix), which contain information about the process.
The original exit function in DOS INT 21/AH=00 . Now, apparently, the DOS developers decided that returning from the program should be a way to exit the program (did this come from CP / M?). RET (nearby) pops a word from the stack and jumps to it. So, when a program is created, its stack begins with the word 0000 . This is the beginning of the PSP. So, at the beginning of the PSP there is code to end the program. To keep this code small, INT 20h acts as an alias for MOV AH,00h ; INT 21h MOV AH,00h ; INT 21h .
[Edit: this can be seen in the screenshot below.]
DOS 2.0 took many things from Unix, including return codes. So, there is a new function INT 21h, INT 21h/AH=4ch , which takes a return code to return it to the OS. This function is also designed to work with EXE files (AFAIR is also new in DOS 2.0), which can have several segments. The previous exit functions (INT 20h and INT 21h / 00) assume that CS is the same as when starting the program in the COM program, that is, it indicates 256 bytes before the program in PSP.
[Edit: 
Historical Note: There were 3 ways to exit the program on CP / M:
- BDOS 0 function call (equivalent to INT 21 AH = 00h, DOS 0 function)
- Go to WBOOTF location at 00:00 (PSP offset 000h equivalent)
- returning
The WBOOTF location consisted of 3 bytes: 1 byte for the transition, 2 bytes for the purpose of the transition (WBOOT function in BDOS).
In early versions of CP / M, calling BDOS 0 or switching to WBOOT led to a reboot of the CP / M parts from the disk (warm boot) and some initialization of the OS, which should subsequently be launched; while RETurning returns directly to CCP (Console Command Processor, the equivalent of COMMAND.COM), which then requests the next command line. AFAIU, CP / M 3 usually loaded into the ROM and returned to the WBOOT location, causing a reboot of the OS parts from the ROM.