The primary function of ABS is to prevent wheel lockup during braking, ensuring vehicle stability and reduced stopping distances.