With the birth of the 7-inch single in the 1940s, record buyers were faced with a dilemma when choosing to spend their hard-earned cash on music. There was the long-playing album, offering a good half-hour or more of music but at a cost. There was also the '45' single, typically around three minutes per side, and significantly cheaper. Occasionally, one would see 'mini-albums' and EPs appear, cheaper than an album and offering more songs than singles; still, they were relative exceptions to the norm. The market was essentially balanced between one vinyl album format and one vinyl single format.
The rise of DJ culture would alter this balance for good. Wikipedia credits the birth of the third vinyl format to engineer Jose Rodriquez, who cut a 10-inch acetate for mixer Tom Moulton. Noticing the oddly small grooves for such a large disc, Moulton asked for the grooves to be spread out, with the end result of superior sound level particularly at a loud volume. Soon, with longer songs being used for discos, the 7-inch single was becoming impractical, and these larger singles rapidly became standard for club music, with a 12-inch disc becoming the norm.
At first, these larger singles were limited to promotional use, sent out to disc jockeys for play in clubs. However, this changed in '76 with the release of "Ten Percent" by Double Exposure, which became the first 12" to be sold to the record-buying public. They were adopted soon by not only disco, but rock and pop artists as well, and now there were three formats in the stores.
So what does a 12-inch single offer above a traditional 7-inch? Firstly, as touched upon above, there is more room for the grooves. All vinyl records store the music as a spiral groove, upon which a needle travels and transfers the vibrations to the turntable, whereupon they are transmitted as music. With more space for these grooves, longer songs became possible, and louder songs are also a reality. The additional loudness makes a 12" perfect for club use, but also provides noticeably better sound reproduction than a 7".
That extra space also allows for additional songs on the record. Whereas singles were usually a single song on the A-side (hence the name) backed by another on the B-side, often as many as three B-sides could be found on a 12", depending on the length of the songs and the speed the record spun at. (A 33 1/3rpm record will fit more songs on but lose sound quality compared to the same song at 45rpm, the usual speed for a single). The A-side was also not immune to change, as many bands took advantage of the longer time to extend the main song into different 12" mixes.
Many bands found the 12" single a welcome addition to the marketplace, perhaps none more so than New Order. The record generally agreed to be the highest-selling 12" single of all time is their seminal 1983 track "Blue Monday", perhaps helped by the lack of a 7" version and its lack of placing on an album.. They were also especially fond of not just remixing, but completely re-recording a track for the 12" mix, although they were certainly not alone in this regard. The 12-inch single also allowed for the same size of cover art as an album, allowing for just as interesting sleeves.
The 12" single was not the only 'new format' to have appeared, but is one of the longest to survive and is still a valid and viable means of buying and selling music. Many Djs continue to use them instead of the compact disc, although the public overwhelmingly prefers CD singles. DAT and Minidisc single formats never appeared. The cassette came and went, never achieving the same popularity as vinyl; they are all but gone from the marketplace. While CDs dominate, 12-inch singles continue to be pressed and sold, and will more than likely continue to do so for some time; even now it's not uncommon to see on a CD single the mention of a "12" version" of the track added as a bonus.
References: Wikipedia, "12-inch single"; New Order, "Blue Monday" (FAC 73)