The algorithm used may be as simple as Round Robin in which each process is given equal time ( for instance 1ms) in a cycling list. So that Process A executes 1ms, then process B, then process C then back to process A.
More advanced algorithms take into account process priority, or the importance of the process. This allows some processes to use more time than other processes. It should be noted that the kernel always uses whatever resources it needs to ensure proper functioning of the system, and so can be said to have infinite priority. In SMP systems, processor affinity is considered to increase overall system performance, even if it may cause a process itself to run slower. This generally improves performance by reducing cache thrashing.