
Chris M. answered 09/06/19
Scientist and Maker with Experience in K-12 Education
I'll keep this answer pretty basic as the actual electrostatic interactions between the molecules can get pretty complicated. I like to think of it with a principle that goes "like dissolves like." This means that substances will dissolve each other if they have similar properties. This is why oil does not dissolve in water and why you can use vegetable oil to dissolve petroleum-based adhesives from jar labels.
In the case of detergents, let's just look at the specific case of Sodium Dodecyl Sulfate (SDS), these molecules look and have very similar properties to the phospholipids that make up cellular membranes.
Because these are "like" molecules, the SDS is happy to intermix in the cell membrane and when that happens it becomes less stable. As more and more detergent molecules mix in, the membrane begins to fall apart and form mixed micelles, especially if you give the system a little bit of engery by heating it up (typically why lysing cells will be carried out at a slightly elevated temperature).
I would say it's not so much the detergent getting in, as it is the detergent getting mixed into the membrane and destabilizing its structure.
I wrote a blog post discussing this with some pictures that I think make it a little clearer. Unfortunately it seems like Wyzant won't let me add pictures to this response. Here's the link: https://www.christophermonaco.com/blog/dna-necklaces-the-hottest-fashion-accessory-of-the-spring
Hopefully that clears it up a little bit!