The amount of lye changes because the different types of oil react with sodium hydroxide (lye) either more or less efficiently. The chemical reaction that turns fatty acids and lye into soap is known as saponification. Different oils have saponification values that reflect their relative efficiency in the reaction. Different ratios of oil to lye are used so that there is no excess lye in the final soap product. Lye is caustic when dissolved in water in the amounts used in making soap. All of it must be consumed in the reaction. All the ingredients in soap should be weighed accurately for this reason. There are several lye calculators available online for determining the correct amounts.