Alkylating agents are a class of compounds that work by adding alkyl groups to DNA, leading to DNA damage and cell death, making them effective in cancer treatment. However, their non-specific action can also harm healthy cells, leading to side effects and potential for secondary cancers.