When I mine in a pool, I see the number of shares and stale ones. What does this mean? What is a share? What the guiminer (the mining program) receives and what it sends? It sends it to whom? How the other end actually trusts that my computer has indeed done so many hashes per second?
I just tried to find a question along the lines "How does pooled mining work?" and didn't find one, so it's very good that you ask. However, I found these related questions: Understanding Shares in Pool Mining, How do mining pools distribute work effectively?, How does a pool know work has been done?– Murch ♦Feb 2, 2014 at 1:34
Regular mining is repeatedly inserting different nonces into the block then hashing it until you find a nonce that makes a hash that is smaller than the difficulty.
Pooled mining is just like this except you don't use the full difficulty, you just have to be good enough for a much easier difficulty that the pool assigns to you. When you find a nonce that is good enough for the pool difficulty, then you tell the pool that nonce. That is a share. The pool verifies that the the nonce is good enough so the pool knows that you did the work. So the number of shares that you send tell the pool that you had to do so much work to find them.
You receive in the first place a block to mine with that you put the nonces into. You also receive a difficulty that the pool wants you to use.
You send the nonce that was good enough for the difficulty. You send this to the pool. You never interact with the network at large.
A stale share is a share that you mined on a block that isn't valid anymore. If the pool sends you a block to mine on, then someone else finds a new block, then you find a share on the old block, your share is worthless now, so it is stale.