In more detail
The mask is a run of one-bits followed by zero-bits. A device applies a bitwise AND of the mask with an address to find the network. Writing the number of one-bits after a slash gives the shorter CIDR form, so 255.255.255.0 is /24. In each block the first address names the network and the last is the broadcast address, leaving 2^n − 2 usable hosts for n host bits; /31 point-to-point links and /32 single hosts are the exceptions. A mask of 255.255.255.192 (/26) splits a /24 into four blocks of 64.
Why it matters
Devices on one LAN with different masks disagree about who is local: one sends traffic straight to a neighbour while the other sends its replies to the default gateway, and connections fail in confusing ways.
Example
With the mask 255.255.255.0, the addresses 192.168.1.10 and 192.168.1.200 share the network 192.168.1.0. With 255.255.255.192, the address 192.0.2.100 ANDs to 192.0.2.64 (last byte: 01100100 AND 11000000 = 01000000 = 64). That network, 192.0.2.64/26, has hosts .65 to .126, broadcast .127 and 62 usable addresses. See How Subnetting Works for the full method.
Common confusion
Cisco access lists use a wildcard mask, the inverse of a subnet mask: 0.0.0.255 there corresponds to 255.255.255.0.