One learns to avoid locking up the brakes by feel and experience. ABS is not necessary, though it is more reliable. For an extreme example, Formula 1 drivers or MotoGP drivers do not use ABS, and yet are able to brake at the very edge of possibility.
Indeed, it is actually possible to brake ever so slightly more efficiently without ABS than with ABS using very slight wheel slip, and smoother braking allows for weight pre-loading going into a turn.
https://www.nathanarose.com/blog/2017/10/4/braking-capabilit...
According to this study, braking using both wheels on modern motorcycles (And, by extension, modern bicycles as both have in the past decade standardized braking systems that operate at the limit of grip) achieved .75G +- .15G. This is without ABS, and the limit using perfect braking at higher speeds yielded deceleration rates greater than 1G.
If the average, skilled rider is able to achieve .7G on modern bikes, this is not at all worse than cars where the average driver is assumed to brake at .4G. According to https://nacto.org/docs/usdg/vehicle_stopping_distance_and_ti... , a moderately skilled driver is assumed to be able to brake at about .5-.6G. This compares favorably.
As for braking technique, it is about extracting as much braking force as possible from the rear tire, then attempting to lower one's center of gravity by leaning down and backwards. An absolutely crucial difference is that in a car, braking is very detrimental to turning, causing over-steer. This is not so on a bicycle or motorcycle, which contributes furthermore to safety, as most accidents are avoided via steering, then steering and braking, and then only braking.
According to this, braking forces of up to 0.83G are possible on a normal bicycle, without suspension nor special positioning: http://www.industrializedcyclist.com/braking-pitchover.pdf