Rituximab works by binding to the CD20 protein on B cells, leading to the destruction of these cells. This is achieved through several mechanisms, including antibody-dependent cellular cytotoxicity (ADCC), complement-dependent cytotoxicity (CDC), and apoptosis. By reducing the number of B cells, rituximab can modulate the immune response, making it useful for treating autoimmune conditions.