Soap and the Spanish for the same, jabón, sound like they have nothing in common. But sounds can be deceiving.
Both come from the same root: the Latin sebum, meaning “grease”.
How can such different words be so related? Easy: the Latin s- sound and its variations (sh-, ch- and sy- for example) usually became, under the Arabic influence, a j- sound in Spanish but remained more intact in English.
Thus, the s-p of soap maps almost exactly to the j-b of jabón. The “p” and “b” are often easily interchanged as well.
Less fun is also noting that, from the same Latin root, meaning “grease” we also get seborrhea (a medical condition of having too much grease on your skin).