If a frame is not available, the pager must make one available, by discarding a frame. It's generally better to evict a clean page than a dirty one because dirty ones must be written to backing store. The current process may give up the CPU while the relevant pages are moved in and out. When the pages are available and the process is runnable again, the faulting instruction is restarted. The whole process is rather expensive, which is why adding memory to a paging system generally 2 speeds up a paging system.
More memory makes the expensive page faults less frequent.
Optimal - page out the page that will be needed the furthest in the future. FIFO - keep a list of pages in the order that they were loaded, we'll talk at length about why this isn't used, but the oldest page isn't always the best one to be rid of. A FIFO replacement algorithm is run, but pages with the referenced bit set are put at the bottom of the queue and given a second chance. The goal is to keep recently used pages in memory. Note that this is FIFO in the limit.