Soap is used for personal cleaning, which increases happiness ("recently took a soapy bath") and lowers the chances of an infection in case they are wounded, and for cleaning wounds in hospitals, preventing infections from developing. It is thus a vital commodity in dwarven health care, and one not traded in caravans: you're going to have to make some soap yourself. Since soap is considered to be a bar it can be used to make constructions and workshops.
Soap is made of two components, lye and fat (either tallow or oil) in a soap maker's workshop. Lye must be produced at an ashery from ash, which in turn must be created at a wood furnace from wood logs that must first be cut down. Tallow is rendered from fat from butchered animals at a kitchen, requiring either livestock or hunting activities, while oil must be pressed from seeds or rock nuts at a screw press, which first requires gathering up or growing crop and then processing them at the farmer's workshop. One unit of tallow or oil plus one of lye creates a single bar of soap.