Two formats wearing one extension
A .webp file can contain two quite different things. Lossy WebP borrows the intra-frame coding from the VP8 video codec: it predicts each block from its already-decoded neighbours and only stores the difference, which is a fundamentally smarter approach than JPEG's independent 8×8 blocks. Lossless WebP is a separate algorithm entirely, built around colour transforms and a dictionary coder, and it competes with PNG rather than with JPEG.
This is why WebP can replace both: for photographs it is typically 25–35% smaller than a JPEG of equivalent quality, and for graphics it is typically 20–30% smaller than the same PNG, bit-for-bit identical.
Transparency without the size penalty
WebP's real party trick is lossy compression with an alpha channel — something JPEG cannot do at all. Before WebP, a photographic image with soft transparent edges had to be shipped as a large PNG. WebP compresses the colour data lossily and the transparency mask separately, so the same image can be a small fraction of the size.
For product photography on transparent backgrounds, hero images with faded edges, and any UI asset that mixes photographic content with transparency, this single capability is usually the reason a site switched.
Why you keep downloading files you cannot open
Browsers negotiate image formats with servers, so when you right-click and save an image from a modern site, you often get the WebP version the browser was served rather than the JPEG you expected. Every current browser reads it, but plenty of desktop software does not — older Photoshop builds, some print shop upload forms, various phone gallery apps, and a good deal of enterprise software.
Converting back to JPG or PNG solves it. Note that WebP → JPG is a re-encode of already-lossy data, so use a high quality setting; WebP → PNG is safe but produces a much larger file, and is the right choice if the image has transparency.
The 16,383 pixel ceiling
WebP inherits a hard dimension limit from VP8: neither side can exceed 16,383 pixels. This is far beyond normal photography but it does bite on stitched panoramas, large scanned maps, and giant poster artwork. If a converter refuses your image, oversized dimensions are the usual reason — TIFF, PNG, or JXL will handle it.