From https://www.science.org/content/blog-post/what-s-ivermectin
> It acts most strongly on glutamate-gated chloride channels, which vertebrates don't even have.
They are like little holes in the wall of the cell of worms that can be opened and closed, and ivermectin locks them in the open position. A much better and more technical explanation https://pdb101.rcsb.org/motm/191