server1 is just an alias for server1.example.com
Your computer checks /etc/hosts before doing an DNS-lookup on a domain. If it finds an entry in /etc/hosts, it uses it. f.eks. 'ping server1' would be the same as 'ping server1.example.com' and the same as 'ping 192.168.0.100'. Well, not the same in that sense, but it would ping the same computer
/etc/hosts also has a historical background. In the old-days, before there were DNS-servers, this hosts file could be downloaded so you didn't have to use IP-addresses, but could use domains instead. After a while, it was inconvenient to use hosts due to updates and changes, and therefor they made a DNS-service.