A simple explanation of the chemical is that it has a fatty acid chain on one end of the molecule, attached to a long carbon chain that makes up a salt on the other end of the molecule.
The fatty acid end will pick up fats, such as oils in hair, while the salt end will dissolve in water. This helps wash away dirt saturated oils, when you rinse shampoo out of your hair or soap off of your hands.
It is quite a nifty and effective chemical. It is abundant enough, and is easily and cheaply attained, which is why it has become so ubiquitous in all types of cleaners and soaps.
This chemical’s ability to remove oils so easily is also why it is found in laundry and dish soaps, as well as in industrial strength cleaning supplies used in places like an auto repair shop.
It is worth noting that just because this same chemical is also used in harsher cleaners, they are by no means used in the same concentration. The chemical is found in a far more diluted form in domestic products.
A critique of sodium lauryl sulfate in domestic products is that it strips your hair or skin of natural oils, which can leave it very dry. This brings about the need for conditioners and lotions that then replace natural oils with synthetic oils.
While this critique is worth bearing for persons concerned with natural, or organic health and beauty care, it does not mean washing with a soap containing sodium lauryl sulfate is hazardous to your health. And similarly, many of the completely natural products can be equally drying.