When a router makes routing decisions, it looks at the destination IP address in the packet and compares it with all of the routes in the routing table looking for a match. Specifically, it looks to see if the IP address is contained within the subnets in the routing table. So for example, if you have a routing table like this:
192.168.8.0/24 route to next hop IP 10.10.10.1
172.16.55.0/24 route to next hop IP 10.10.20.1
172.16.58.128/25 route to next hop IP 10.10.20.1
0.0.0.0/0 route to next hop IP 10.10.30.1
Let’s say a packet comes in to the router with a destination IP of 172.16.58.144. It will look through the routing table to see if there is a route to a subnet within which this destination IP address exists. Now the subnets expressed in the routing table essentially define ranges of IP addresses. Specifically, the 172.16.58.128/25 subnet has a range of IP addresses from 172.16.58.128 to 172.16.58.255 (including network and broadcast addresses). The destination IP address falls into this range, so the next hop IP that is used is 10.10.20.1 as indicated in the routing table.
Now if a packet comes into the router with a destination IP address of 192.168.1.50 for example, you can easily see that this is not in the ranges of IP addresses defined by the first three subnets which are:
192.168.8.0 to 192.168.8.255
172.16.55.0 to 172.16.55.255
172.16.58.128 to 172.16.58.255
However, the 0.0.0.0/0 subnet also defines a range of IP addresses. This range is 0.0.0.0 to 255.255.255.255, in other words, all of them! Why? Because a subnet mask of 0.0.0.0 or a designation of /0 essentially says that the whole address is a host portion of the network. Therefore this is a subnet that contains all possible IP addresses.
Naturally, if the destination IP address doesn’t match any of the first three subnets or IP address ranges, it will definitely match the 0.0.0.0/0 range. This is like a catch-all last resort bucket that matches everything that is not matched by a more specific routing table entry. So this is why this is the default route.
Now in your post you indicated 0.0.0.0/24. This actually defines an IP address subnet with a range from 0.0.0.0 to 0.0.0.255. I believe you meant to write 0.0.0.0/0 which is indeed the definition of a default route. Is that right?
I hope this has been helpful!