When the xterm terminates, xinit and startx kill the X server. In general, xinit and startx can start an arbitrary server and run an arbitrary script. Typically, this script runs a number of programs and a WindowManager.
The two alternative methods for starting an X server is by using a ?X_display_manager and starting the X server and then manually starting one or more clients. Using a display manager is the most commonly used method.