If both servers are within the same LAN or local network (connected to the same switch or router) then some Firewalls allow internal traffic on the same subnet without issues.
Anotherwards, they simply communicate and the Firewall stays out of their way.
However, when the 2 servers are in different subnets OR one of them is being accessed over the Internet (WAN) THEN special rules must be setup on the firewall which allows that traffic to go through.
Some examples of a firewall rule would be:
Allow ALL access to a specific destination IP such as 10.160.21.132
OR
Allow all traffic only on ports 7412-7415
Firewall rules can also restrict which protocols are used, such as UDP or TCP as well as enforce timestamps, such as: ALLOW between 8:00AM to 5:00PM but not 5:01PM-7:59AM
Firewalls can also have different inbound and outbound rules. Meaning that it can allow 1 server to communicate with another one (outbound) But Deny access from the external server trying to reply back (inbound)
Windows XP SP2 or later had built into it a very basic Inbound firewall only. It only blocked things externally from coming into the computer. It didn't care what was sent out from the computer.
Windows 7 has a more advanced inbound/outbound firewall which can protect both what is coming in as well as going out of the computer.
Home firewalls on most Routers have only very basic Firewall rules. Usually port rules, time rules and protocol rules.
For a computer over the internet to access your home computer, you often times need to enable "Port forwarding" which forwards any traffic on a specific port to a specific computer at your house which can respond to those requests.