@Muzan, it’s none of those - your first one is object visibility, the second one is collision layer masking for Physics 2 objects.
Sprite masking is an extension, and could probably do with bit better documentation. It’s also reasonably processor hungry.
A sprite mask lets you show only a part of a sprite. When a sprite passes under a sprite mask, part of the sprite is displayed. This post that has a couple of links to sprite masking examples - the first used the Chick’s image to define the mask. Notice the pinkish purple ‘particles’ only play within the shape of the chick.
With the second example (click and drag for the x-ray effect), the sprite mask shows the green sprite in parts, and where it’s not supposed to, it hides the green sprite so that the background appears instead.