An annular preventer closes on a range of pipe sizes and on open hole. Ram preventers are built to close on a particular pipe size, to cut the pipe, or to seal an open hole. The stack is the second barrier. The first is the hydrostatic pressure of the mud.
A preventer that is not tested, or a ram that does not match the pipe in the hole, is not a barrier. Closing it is the start of well control, not the end: the kick still has to be circulated out through the choke at a calculated pressure.