Name and IP address space collisions existed before Macs were invented, and especially before Dynamic Host Configuration Protocol (DHCP) became available. It required careful system administration to avoid this issue.
If your router is correctly configured to provide DHCP services and your individual Mac(s) have the correct Network settings to receive the unique DHCP assignment from your router, then there should never be a need to change the default /etc/hosts file.
Here is the unmodified /etc/hosts file from my Ventura 13.3.1 Mac:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
On each Mac, there should also be a unique local hostname set in Settings > General > Sharing panel. Check and correct that where necessary.
If you are using a Virtual Private Network (VPN) to connect to an outside service, that can temporarily change your local hostname via reverse DNS to a unique service originated hostname. This reverts when you disconnect the VPN connection.