The ping command is used to test network connectivity between two machines. This is done by a host sending network data to another machine on a local or external network, and the other machine responding if a connection is established. This allows for a test of network connectivity between two machines, and can also diagnose connectivity issues over a network.
In the example above, the user wishes to test their connection to google.com. The command is issued, and the website replies to the request. The connection is alive, and will continue to test the connection until the user closes the process.