B cells contribute to tumor immunity by producing antibodies that bind to tumor-associated antigens. This can facilitate the destruction of tumor cells through mechanisms like antibody-dependent cellular cytotoxicity (ADCC) and complement activation. Additionally, B cells can present antigens to T cells, enhancing the overall immune response against the tumor.