Lockup is a situation in which the brakes make the tires completely stop turning. This can cause serious tire wear when done too frequently, and, more often than not, makes the car spin out. Lockups can be avoided by installing anti-brake locking systems on cars, but modern cars have one as standard or optional features.
Almost all cars have a hydraulic braking system. The hydraulic fluid creates pressure which causes the brake pads to make contact with the brake rotor. When done carefully, it will bring the car to a fast, efficient halt. However, when done too hard, the pressure and friction created between the pads and rotor will stop the rotor dead, which causes the tires to enter a slide.
The best way to avoid lockup is to set your ABS setting to 1, so that it's just enough to prevent lockup but also enough to get the car slowed down.
Also, try to apply the brakes slowly, until you realize you slow down. For cars with manual transmissions, downshifting is recommended, with the brakes slightly applied. Applying the clutch to stop transferring power to the wheels should also be done.
Another way is to slowly ease on the brakes, keeping in mind your car's power-to-weight ratio. Lighter cars with more power are generally more sensitive on the brakes.