Masks are grayscale images whose grays control visibility of a layer, group, or Smart Object.
A Metaphor and Example
Although Photoshop thinks of masks as alpha channels, that’s not so easy for humans.
Some users who find the concept of masking challenging find this metaphor useful—if they’re familiar with slides (photographic transparencies). Images recording onto slide film are most opaque where they’re darkest. Whites in a scene (snow, clouds, etc.) are rendered as clear film. So, the dark parts of a slide hold back the projector’s light while the more transparent parts that represent the lighter part of the image allow the light to reach the screen.
Now imagine sandwiching two slides together and projecting the result ...