The exit() function in C++ terminates the entire program immediately, not just the current function or loop. It performs cleanup and ends program execution. Option D correctly states it causes exit from 'the program in which it occurs'. This is different from return, which only exits from the current function. The exit() function is defined in header and affects the whole program.