The Static library.
is a set of routines, external functions and variables which are resolved in a caller at compile-time and copied into a target application by a compiler, linker, or binder, producing an object file and a stand-alone executable. This executable and the process of compiling it are both known as a static build of the program. Historically, libraries could only be static.
The main reason to use it:
Libraries encourage the sharing of code in a modular fashion and ease the distribution of the code.
The behavior implemented by a library can be connected to the invoking program at different program lifecycle phases.
His job:

Compilation Process
Static libraries are added during the linker phase of the compilation process (above). During the linker phase: the linker links access all the libraries to link functions to the program. Static libraries are merged with other static libraries to create an executable program. During the compilation of a program, the static library is called to execute the program.
Creation:

1. Create a C file that contains functions in your library.
/* Filename: lib_mylib.c */
#include <stdio.h>
void
fun(void)
{
printf("fun() called from a static library");
}
We have created only one file for simplicity. We can also create multiple files in a library.
2. Create a header file for the library
/* Filename: lib_mylib.h */
void
fun(void);
3. Compile library files.
gcc -c lib_mylib.c -o lib_mylib.o
4. Create static library. This step is to bundle multiple object files in one static library (see ar for details). The output of this step is static library.
ar rcs lib_mylib.a lib_mylib.o
5. Now our static library is ready to use. At this point we could just copy lib_mylib.a somewhere else to use it. For demo purposes, let us keep the library in the current directory.
Its use:
Let us create a driver program that uses above created static library.
1. Create a C file with main function
/* filename: driver.c */
#include "lib_mylib.h"
void
main()
{
fun();
}
2. Compile the driver program.
gcc -c driver.c -o driver.o
3. Link the compiled driver program to the static library. Note that -L. is used to tell that the static library is in current folder (See this for details of -L and -l options).
gcc -o driver driver.o -L. -l_mylib
4. Run the driver program
./driver
fun() called from a static library