dnsmasq is a lightweight DNS forwarder and DHCP server used primarily in embedded systems (like routers) where resources are limited. DNS queries are small in size but latency introduced can be significant depending on the proximity of a DNS server that can answer the query. DNS queries are usually cached either by a web browser of by the operating system but if several clients are connecting to the Internet through a router they would all need to send 'possibly' same DNS requests over again. That's why dnsmasq running on a router has a local cache for DNS queries.