Let's say there are two pc's and they are connected via. Router.
Here is the image that explain everything.
The pc1 has IP address - 220.127.116.11 and pc2 has IP address - 18.104.22.168. The router IP address is 22.214.171.124. When pc11 wants to communicate to pc2, then do they need to speak to router? In my opinion, when the destination and src ip address is in the same subnet - there will be an arp request to get the destination machine address. So, the router will not come into the picture. Do you agree with it? So, basically the ip address will be broadcasted to know the mac address. If the arp succeeds, then the destination is found and the communication can happen. On the other hand, if the destination ip address is in the other subnet then the router will come into the picture and will route the packet to the destination ip address. Then again the arp will be done to reach out the destination machine. Is my understanding correct?