This kind of broad question doesn't really imply a specific answer, so I'm going to go with an equally broad answer that, while not precise, might still be helpful.
You'll want to know the basic idea behind Fourier's Theorem which is that all waveforms can be expressed as a sum, possibly infinite, of sine/cosine waves. Wikipedia's page on Fourier series strikes me as good, although it's more technical than you might need, what with all the math. This is the idea on which Fast Fourier Transforms work - take a sample of your signal in, get a mostly-correct list of the component sine waves (which is to say, frequencies) which sum together to make that sample.
From those you can decide which one is your fundamental frequency, and convert it to a note based on what its pitch is.
Digitized sound works, like Lennart Regebro said, by simply writing down the amplitude of your soundwave on a regular interval as a number. There are two factors you'll immediately be concerned with: Sampling Rate, which is how many such notations are made per second, and Bit Depth, which is the amount of data and therefore the resolution of those notations. You might've seen 44.1KHz/16bit in reference to CDs. That's what these are: 44.1 thousand samplings per second, and each one of them is 16 bits, so possible numbers are 0 to 65535.
Do keep in mind that I've never written such an application, but this is what I've picked up about how such software works.