It was my understanding that PNG can be lossy, for better compression ratios, but it doesn’t have to be. And unlike the GIF format that it was created to replace, it can do a decent job with photographs, but JPEG is still better for that purpose (especially photographs of people).
The one I don’t get is WebP. In The Beginning, there was GIF and JPEG, plus various simple lossless formats like BMP. BMP images were always too large to be practical for anything over a network, so browsers all supported the compressed GIF and JPEG formats. And GIF and JPEG worked well for different kinds of images, so there was a pretty good breadth of capability, between the two of them.
Then, though, there were some legal questions about the rights to the GIF format (IIRC, it was owned by Compuserve, and they were flexing their muscles about not letting anyone else use it). So PNG was created as a replacement, that was (mostly) good at the same things as GIF. Adoption of PNG support was rocky at first, but nowadays they’re pretty universal.
And then there came SVG, which served a different purpose than GIF or JPEG. It’s a vector format, not a pixel format at all, which means (among other things) that you can zoom in or out as much as you want without ever losing quality. And as a bonus compared to other vector formats, it was based on HTML, so it was easy to make web browsers support it. Unfortunately, support for SVG is still uncommon in anything other than web browsers, but there’s still a good reason for it.
WebP, however, doesn’t do anything new, and it’s not supported by ANYTHING other than web browsers. It might have slightly smaller file sizes than JPEG, but with network speeds what they are nowadays, that slight improvement makes almost no difference. Why anyone wants to use WebP, given the marginal benefits and utter lack of support, is beyond me.