So, I posted this a while ago in -ck's solo pool thread when somebody asked about shares. Since I just got a PM from a miner on my pool asking about shares and how they relate to payments, I thought I'd post it again here.
When you mine on a pool, you combine your hashing power with the other members of the pool in an attempt to solve a block. So, what are these shares?
Well, mining hardware knows how to do exactly one thing: provide potential block solutions by performing double SHA256 hashes. Each execution of that function produces a result. For example, an Antminer S7 miner executes this function roughly 4.75 trillion times a second. This is the number you see when looking at a miner's hashing power. Usually it is expressed in values like "terra hashes per second (TH/s)". That S7 is about 4.75TH/s.
Now, the vast majority of those shares are useless - they'll never possibly solve a block. Since we don't want to flood the network, or a pool, with such a giant amount of useless data, we assign an accepted minimum value that must be provided by the miner as a potential block solution. That value is referred to as a "difficulty 1 share".
At any rate, you can use math to figure out how long you would expect it to take to find that baseline share (diff 1). The formula for doing so can be simplified to:
2^32 / hashrate = time to find a diff 1 share
Applying that formula, you can easily calculate that your S7 expects to find a diff 1 share every 0.00090420364126 seconds. Inverting that gives you how many diff 1 shares per second your S7 should find: 1105.94555735974321.
Now that you have this, and you know the current network difficulty, you can figure out the expected time to solve a block:
current diff / shares per second = time in seconds to find a block
Again, using the S7 as an example, at the current difficulty, you would expect to find a block after hashing for 161561576.41029279010546 seconds. Convert that into days and you'll see an S7 would expect to take 1869.92565289690729 days to find a block.
Given this information, you can then figure out what your expected daily earnings are for an S7 because you know the current block reward is 25
BTC. Simply take 25 and divide it by the number of days to solve a block and you'll get 0.01336952
BTC a day.
Putting all that together into a single formula:
25 / (current diff * 2^32 / hashrate / 86400) = expected earnings per day
If you want the more advanced version of that formula (one that doesn't approximate a diff 1 share to 2^32), here it is:
(reward / (2^256 / (((2^224 - 2^208) / difficulty) * hashrate))) * 86400 = expected earnings per day
Now, with the math out of the way, you can see that even storage of difficulty 1 shares would be an absurd amount of data to track. This is where the concept of variable difficulty comes into the picture. The pool really wants to track only a certain number of shares per second. Looking above, you can see that the S7 produces over 1100 difficulty 1 shares per second. However, if I increase that difficulty, the expected number of shares per second decreases. Since I know I want to get, for example, 10 shares per minute, the pool simply changes the difficulty of accepted solutions to try and achieve that.
Hope this helps you understand how shares work in a pool.