Question: In many programs and man pages of Linux, I have seen code using `fork()`. Why do we need to use `fork()` and what is its purpose?

Answer: 
Fork creates new processes. Without fork you would have a unix system that could only run init.
The rationale behind fork() versus just having an exec() function to initiate a new process is explained in [an answer to a similar question on the unix stack exchange](https://unix.stackexchange.com/questions/31118/why-is-the-default-process-creation-mechanism-fork).

Essentially, since fork copies the current process, all of the various possible options for a process are established by default, so the programmer does not have supply them.

In the Windows operating system, by contrast, programmers have to use the CreateProcess function which is MUCH more complicated and requires populating a multifarious structure to define the parameters of the new process.

So, to sum up, the reason for forking (versus exec'ing) is simplicity in creating new processes.