Hm. Does that make any sense..? It's been many years since I studied this, so I'll not claim I know this better than you, but could you take your time explaining why they are ANDed?
Looking at the last 8 bits with a mask of e.g. 255.255.255.0 and adresses ...1 and ...2:
00000001&00000000 = 00000000
00000010&00000000 = 00000000
Thus all addresses resolves to 0, don't they? That doesn't make any sense?
I thought I understood this...
Sure lets just take the last octet. You used the simplest example a 24 bit mask where the last 8 bits are "insignificant" to the desired product.
So your operand is always 00000000 - the result of 0000000 and any number is always going to be 0 - a False. False means the IP address is within the local subnet and does not need to be forwarded.
In IPV4 the purpose of the subnet mask is to define the "interesting" traffic for the routing table. So the traffic that
does not match the bitmask is sent to the next entry in the routing table.
The default route is the "route of last resort" and is processed after all other routes in the table.
So the result of the bitwise and of the destination IP and the subnet mask is the switch that activates the route.
We are so use to seeing the trilogy of the Address/Subnet Mask/Default route that we forget the subnet mask is not a part of the address.
Since most IP stacks compute the address for the broadcast messages from the subnet mask it is important to populate it correctly.
Does this help?