Basically, when applying you have two systems. One is the military (military programs, AD non-categorical internships, civ deferred/sponsored) and the other is the normal civ match. You can apply to a civ program all you want, but you must have permission from the military to do it regardless of acceptance (you need to have a differed or sponsored slot). The military match trumps any civilian program acceptance. You could have a letter from the best program in the country, but if the military doesn't have a spot for you that year it doesn't matter.
Keep in mind, the availability of deferment will vary from year to year and from specialty to specialty. The military will preferentially fill AD slots.
If you apply in a year when deferments are not necessarily being offered or when there is a small applicant pool, you may be pushed to an AD slot. If the pool interested in that particular specialty is heavily weighted towards HPSP graduates, the competition for a deferred spot can actually be stiffer than for an AD program.
As an example, you could rank deferment as your first choice. But if there is 1 fewer applicant than AD slots, you will most likely get an AD slot.
It was a long time ago, but the year I applied my specialty had exactly 0 deferred spots. Fast forward a few years and they offered 10 or more. The last few years we have had a decent number, but it's starting to draw down again.
Like many things, it all depends on timing.