Actually, AP1 primaries are also outside the spectrum locus, which makes them physically unrealizable (“virtual”).
Keep in mind that both AP0 and AP1 are just a definition of the colorimetric encoding. The encoding tells you what the numbers in the files represent - think of it as the legend or key to decipher the bits in a file back to something meaningful (colorimetry). It’s just math.
The decision about where to place primaries usually comes down to encoding efficiency. As @nick mentioned, the AP0 primaries enclose the entire spectrum locus but “waste” a lot of space for physically unrealizable colors. Keep in mind that if we have negative numbers available to us, we can encode values “outside the primary triangle” too.
Any set of primaries could be used to encode, but it really comes down to what is the most efficient for the colors one is likely to encounter. In the ACES spec, which uses AP0 we use 16-bit half float so we can encode positive and negative numbers at a pretty high precision and can “get away with” the inefficient triangle enclosure. If we only had 8-bit positive values, it would be much more important to have a tightly enclosed triangle around the region of colors we most care about.
Sometimes, negative values can also interfere with math operations such as those found in visual effects. This is part of the reason why alternate primaries, AP1, were established for ACEScg.