A Mil-spec stock is required when you have a mil-spec buffer tube. The buffer tube is also called the lower receiver extender. Mil-spec tubes are smaller in diameter and have threads that are larger than the actual tube. The mil-spec tube is ~1.48" in diameter. Mil-spec tubes also tend to have stronger threads which leads to a better overall gun setup. The tube is made from 7075-T6 alloy which creates 1-3 and 16-16 UN thread rolls. When being manufactured, the threads are first lathed as normal, then the tube is milled down to the military specific standards.
A commercial collapsible stock will fit on a buffer tube that is ~1.168". They were created as a cheaper version to reduce costs to those wanting to have a more cost effective setup. They cost less because the extension is manufactured from an extruded tube and the tube has a welded on cap that's usually made from a lesser metal. The threads match the 1-3 and 16-16 threads of the mil-spec but may not be as durable. The commercial stocks are often slanted at the point of attachment.
The differences between the mil-spec collapsible AR15 stock and the commercial collapsible stock are small but very important. The stocks can look almost identical but key differences will determine whether or not you have a successful setup. When deciding between a mil-spec and commercial collapsible stock its important to note that the buffer tube size is the most important consideration.
These stocks are not interchangeable so tube size must be considered. If you wish to switch from either mil-spec to commercial or vice versa you can change out the buffer, tube and spring. Mil-spec stocks will often give you more options as far as the type of stock you want. They just tend to be more common and you can find a wide variety of collapsible mil-spec stocks. Also it's usually found that with mil-spec stocks, the fitting may be more consistent over different brands.
It's not always true but the following brands normally will use a mil-spec stock: Colt, Bravo, Daniel Defense, Smith & Wesson, Ruger and Spikes Tactical. Sabre, Bushmaster, Rock River, DPMS, and Olympic Arms usually will require a commercial collapsible stock. A commercial AR stock will go on a mil-spec tube but won't fit exactly as it should and may leave some play at the connection, whereas a mil-spec stock will not fit on a commercial tube at all. Commercial stocks tend to be slanted at the attachment point where mil-spec stocks will be straight. Milspec stock tend to cost more than commercial stocks because they are costlier to manufacture but you often get a return on your investment based on the higher quality of the mil-spec stocks.