Pinging basically sends a request for a response from the target server/location and such that is capable for returning a ping.
It's basically like a "hello? are you alive?" for a computer to another computer.
The ping also known as latency, will also show the milliseconds (ms) between the server and the computer.
Most gamers know this because the higher ms or latency someone has, usually means they will lag in-game.