Nikolay has described it accurately. As Niall has pointed out, in general masks are transparent to processes in PixInsight. This means that a process does not care about its target image's mask. The core application filters a process' result through a mask, if there is one active and enabled, after process execution. This is coherent with PixInsight's object-oriented, modular architecture and design: processes and images are independent objects. From the user's perspective, by separating process execution from masking we gain in modularity and hence in reusability (the same process instance can be applied through a different mask) and versatility (it is much easier to compare the result of a process with and without a given mask if process execution and masking are separate, unrelated procedures).
In the case of PixelMath, you can use the target image's mask with the $M (or $mask) metasymbol. For example, the following expression:
$T*$M
will multiply the target image by its current mask, or will yield a runtime error if there's no mask selected for the target image. Note that if the mask is currently enabled, the result of the above expression will also be masked. If the mask is disabled, the result will be the plain multiplication (possibly rescaled if the rescale result PixelMath option is enabled).