Pitch Detection
As often misunderstood, pitch and frequency are not the same thing: while frequency is a pure physical quantity, pitch has to do with perception or psychology.
Let's take an example: the low E string of a guitar has a frequency of 82.4 Hz. If you produce a pure sine wave with the same frequency (for example with Audacity), the result will sound artificial and sterile. How do we get the typical sound of an instrument - as for example of a guitar? The keyword is "overtone": every string instrument (guitar, ukulele, mandolin, etc.) produces two different kind of tones: the keynote (thus the tone with the fundamental frequency) and multiple overtones. In addition, it often occurs that overtones are stronger (thus they have a higher amplitude) than the keynote. That's also a reason why frequency detection can be so difficult.
Please take into account that we talk about keynote (or fundamental frequency) when it deals with tuning an instrument (as for example with this IOS app)!