I suppose the answer is that any manufacturer of a keyboard instrument, be it a piano, organ, accordion, etc., is free to build whatever instrumental mechanism to produce as many pitches as they want to create, and is free to design a keyboard to play those pitches. They put it on the market, and the successful models sell well, and establish a precedent, while the unsuccessful models do not sell well, and those designs become less popular.
In the early days of the harpsichord and piano (up until about 1815), it was a physical limitation of the mechanics of producing lower pitched notes or higher pitched notes that sound good and are stable. For instance, the exact compass of notes in the standard 61-key keyboard was settled on because it was judged not practical to produce lower pitches or higher pitches with the technology available at the time, e. g. an all-wooden piano frame rather than iron or metal, and using bronze strings, not steel. A keyboard was thus designed to play the pitches based on what the physical mechanism for producing the pitches could accommodate.
A standard harpsichord played exactly the pitches it did because of the amount of tension that a wooden frame could accommodate without warping, and because strings could only be engineered to be so thick or so thin and produce a good, stable sound. When composers wrote music for the harpsichord, they depended on all harpsichords being able to play the same pitches so that one particular piece of music could be played on any harpsichord. Of course all during the history of the harpsichord, different instrument makers experimented with variant designs with different pitches, but eventually a standard was established based on common practice and the marketplace.
Later on, the iron frame was introduced, alongside later technological developments for strings, involving other alloys and wrappings on the strings, and methods of stringing. From about the year 1815 forward, The exact compass of pitches on a piano, and the number of pitches it could play, and the number of keys on the keyboard, gradually began to expand as various manufacturers tried to develop new technologies and designs. From around 1815 to around 1920, there were many pianos on the market with widely varying numbers of keys, all based on mechanical considerations. Eventually we got from 61 keys to 88 keys. Then composition came into play: composers wrote a lot of piano music with the expectation that it be played on an instrument with 88 keys and pitches, so most people wanted to purchase a piano with 88 keys so they could play any piece of piano music on it.
In the last 100 years, with electronic instruments, other considerations come to bear. In the first half of the 20th century many electric keyboards such as some Hammond organ models had an "F" as the lowest pitch. This became unpopular in the rock era because the lowest pitch on the guitar and bass guitar are "E", so electric instruments with keyboards that had "F" as the lowest pitch were less useful in a band with guitars.
In summary, things are the way they are because of many centuries of development in the technology of acoustic, mechanical, electro-mechanical, and electronic instruments. Musical instruments are not designed and built based on "integer factors"; they are based on practical considerations of mechanics and acoustics and materials engineering.
12n
. The+1
may be optional -- but smaller midi controllers tend to be12n+1
(e.g. 25 or 37 keys).