Why it is smaller than JPEG
The difference is architectural. JPEG describes each 8 × 8 block independently using a frequency transform. WebP's lossy mode borrows intra-frame prediction from the VP8 video codec: it predicts each block from the pixels already decoded above and to its left, then stores only the difference between the prediction and reality.
Most of an image is highly predictable from its neighbours, so those differences are small — and small numbers cost few bits. That single change accounts for most of the 25–35% advantage.
It also degrades more gracefully. At low quality WebP tends to blur, where JPEG breaks into visible 8 × 8 squares. WebP at quality 60 is still usable; JPEG at 60 generally is not.