As a miner finds shares, each share's difficulty accumulates on that miner's "account". When the pool finds a block, all miners' accumulated shares are reset to 0, and the cycle restarts till the pool finds a block again.
Upon finding a block, the block reward (minus the pool fee) is distributed to miners in proportion to their accumulated share difficulties.
So a miner finding two shares at difficulties 2000 and a miner finding one share at difficulty 4000 will be allocated the same percentage of the block reward. Finding a share at difficulty X happens twice as often as finding a share at difficulty 2X, on average.