Soap is an emulsification agent. Oil and grease are not soluble in water (they don't dissolve in water), which is why, for instance, oil and water will separate when combined. This is because oils are non-polar molecules, but water is a polar molecule, and non-polar things do not mix well with polar things. In order to remove oil from clothes or from your dishes with water, the oils must be made soluble by the process of emulsification.
The non-polar end adsorbs the oil or other hydrophobic dirt. The ionic end is highly soluble in water. This allows for an emulsion to be formed. The alkali metal (sodium or potassium ion) does not play a role in the action of the soap.
Soap use is not a chemical reaction, but a physical one. Under normal conditions, the soap does not react with the dirt chemically. If "hard water" minerals are present (magnesium or calcium) these can chemically react with the soap and lessen its effectiveness by removing the soap from solution.
The structure of the emulsion is such that the oil or oily dirt is surrounded by soap molecules with the ionic part of the molecules toward the outside where water will react with the ionic end (by hydrogen bonding) and keep the oil in "solution." Hot water helps in the formation and suspension of the emulsion.
Other additives are sometimes added to soap for antibacterial or antifungal effects, but these are not the main ingredients -- they just enhance the primary function of emulsifying oils in water.
See the Web Links for more information and pictures of soap molecules interacting with oil and water.
Soap alone cannot remove dirt or kill germs-- it is the act of running water along with the oils in the soap that help loosen the dirt and rinse it off of your skin. Soap will not destroy the dirt or even germs but the ingredients in soaps such as lye, will make a hostile environment where germs cannot survive. Anti bacterial soaps do kill some bacteria but not all of them and it
will not kill any viruses. So, the best way to keep your hands free and clear of germs is to rub your hands and the soap under water and make lots of lather, then rinse thoroughly with plenty of clean water. Cold water will work fine, but warm water will help dissolve oily dirt making it easier to rinse off of your skin.