Latency is distance related. So let’s say your in China, playing someone from America. There will be a large delay in what happens onscreen because the actions take a long time to send over the network due to the long distance of travel.
Ping is basically how good your internet is by itself. If you have a bad ping, or high ping, expect stuttering movement, and crappy gameplay overall.
That’s technically the ‘gist’ of it all. I probably made some errors, so feel free to correct me.