There is a computer that can tell, for each wheel, the speed the wheel is spinning, and also the rate at which the wheel is decellerating.  The computer also controls a set of valves that regulate the brake fluid pressure to each tire.  When the brakes are engaged, the computer monitors the wheels, and if any wheel begins to lock up, the computer releases the brakes on that wheel a little, until it speeds back up slightly, and the process repeats until all four wheels have stopped.
how abs works?