Masks are single-channel images used to perform per-channels
manipulations. They are stored globally, and therefore are not attached to a
specific layer. Note that masks are not saved with the image. If you want to preserve a mask, you must export it to an excluded layer.