Dear Synque,
That is a question that can’t be answered in just a few lines. There is quite a lot to it. If you are really interested in the subject you might consider studying online. Here is one resource that might get you started: http://www.electronicstheory.com/COURSES/ELECTRONICS/e101-1.htm