You've been asking about history on other answers, so I wanted to address this.
The first historical answer that could be given would be "they didn't care." If you're just playing solo, you often don't need to line up "perfectly" with an particular pitch. Instruments could vary accordingly. You'd simply make the instrument play one note that's "roughly" in the right place, and then tune the rest of the instrument from there.
This process is great until you have to have two instruments play together. When they have to play together, they have to agree on which pitches they're going to play. One approach to this is to have every pitch variable. Many old stringed instruments could retune strings or even move frets.
Now, to take the step towards "middle C," you have to play this way for a bunch of years. Over time musicians will start to realize that it's cheaper and easier to play together if all of the instruments "agree" on a pitch. Musical instrument makers started standardizing their instruments to suit. It might be a local standard, or a worldwide size and shape. All that mattered was that they agreed enough.
Eventually we standardized on a tonal system which centered around the pitch of the note we now call A4. It's currently specified to be 440Hz (it's varied through the years a bit). We can then define A5 A6, etc. by doubling that frequency (880Hz 1.7KHz respectively). Any instrument that wants to play well with others will be judged by how well it matches those reference frequencies. Of course they didn't phrase it that way at first. However, there are many shapes of resonators which can be constructed to a fixed size and thus resonate at a given frequency. The numeric frequencies came later -- reproducible shapes and sizes came first.
Now days, even with the ubiquitous standard of A4=440Hz, we still tune the same way they did in the days of yore. Due to atmospheric and temperature changes, instruments change tuning all the time. In an orchestra, everyone adjusts their tuning to that of the oboe because the oboe has the least room to adjust their pitch (due to the design of the instrument). The one exception is if there is a piano on stage, in which case the piano is even harder to re-tune than the oboe, so everyone tunes to the piano instead).