Nodes download the most recent portion of the sharechain from their peers.
From the wiki:
Is there persistence for the sharechain?
Does restart the p2pool daemon mean it has to re-acquire the sharechain from scratch?
Yes, you're mining on the assumption that the pool is not going to disappear while your shares are valid. I'm not sure exactly what you mean with the second question, but the sharechain is persisted to disk, so when you restart your node, it only has to download shares since it was stopped.
Why is the difficulty of the sharechain not linked directly to the main chain's difficulty?
Related to that is why not just keep 24 hours worth of main chain blocks?
"Heads" are shares without child shares (leaves of a tree structure). "Tails" are shares without their parent present (roots of a tree structure). The difficulty of the sharechain is unlinked so it can go as fast as possible, which we've empirically determined to be something like 20 to 30 seconds. Keeping 24 hours worth of main chain blocks would require storing an unbounded number of shares in memory, which is a bad idea.