Consider the subnet mask 255.255.255.0 in its binary form, which is:-
11111111 11111111 11111111 00000000 , hence it includes 24 1's which is why it is mentioned as /24,
similarly 255.255.255.192 is considered as /26 because it includes 26 1's. It is considered a shorthand notation, as it simply explains the subnet mask without writing such a big address.
CIDR notation is related to subnet masks as it provides a shorthand way of representing IP addresses along with their associated subnet masks. In CIDR notation, the subnet mask's information is condensed into a forward slash followed by a number, denoting the count of bits set to 1 in the subnet mask. For instance, instead of stating the detailed subnet mask like 255.255.255.0, CIDR notation shortens it to a more concise form like /24. This shorthand notation is considered efficient for expressing IP address ranges and subnet mask details in a simpler and more compact manner.