In addition to the uses mentioned above, there are many, many other uses. For example, I might paste into, or directly write to a layer mask large geometric patters, small repeating patterns, gradients, parts of the main image or many other things.
One example of pasting parts of the image into a layer mask might be if I want to correct the color of the faces towards the right in a group shot, I'll first select all skin tones, turn that into the corresponding layer mask, then brush black everywhere else to remove skin other than the faces. I might then overlay a gradient onto the layer mask to make the adjustments favor the right side, and taper off to nothing on the LHS.
There are a huge number of things once can use this for. If I had to guess, I probably use this sort of technique every single day I am working in PS.
Tom