Also known as lye, sodium hydroxide is a highly alkaline and is a necessary ingredient in soapmaking. The chemical process that occurs when the lye comes into contact with fats and oils is called saponification. Once the soap has saponified there is no lye present in the soap. That is why sometimes you will see some soap ingredient labels specify sodium olivate, or sodium palmate. That means that it was olive oil or palm oil then mixed with lye and became a new substance.
Fun Fact: Sodium hydroxide is used in a solution to make pretzels and bagels.