The pigment present in molasses-based distillery effluent constitutes a primary factor influencing its degradation. Adsorption is an effective approach to eliminate pigment from wastewater. In this study, a cationic cassava starch (CCS) magnetic composite (CCS@Fe3O4) was prepared and used as adsorbents for the removal of undesirable pigments. The adsorption behaviors of caffeic acid (CA), gallic acid (GA), and melanoidin (ME) on CCS@Fe3O4 in the wastewater were investigated using single and ternary competitive adsorption systems. The equilibrium adsorption capacities of CA, GA, and ME on CCS@Fe3O4 were 197.04, 195.55, and 623.97 mg/g at the optimized conditions (0.3 mg/mL CCS@Fe3O4 dosage, temperature of 38 °C, and pH of 7). The adsorption kinetic model showed that chemisorption accounted for most of the adsorption of CA, GA, and ME on CCS@Fe3O4. The adsorption mechanisms of pigments on CCS@Fe3O4 were explored at the molecular level through quantum chemical calculations. The electrostatic potentials (ESP), average local ionisation energy (ALIE), and Fukui indices calculation indicated that the quaternary ammonium group in CCS@Fe3O4 was more susceptible to electrophilic reactions. The CC and benzene rings in CA and GA, and the COO- in ME, represent sites of attack for quaternary ammonium during adsorption. Furthermore, the competitive adsorption results, adsorption energy, and electron transfer data demonstrated that the adsorption capacity of CCS@Fe3O4 for pigments followed the order ME>GA>CA. Overall, the competitive adsorption mechanisms of CA, GA, and ME on CCS@Fe3O4 were unveiled, with quantum chemical calculations offering crucial insights into the adsorption process.