Note: I originally made this comparison in 2013, and promptly forgot about it until mid-2017, when I decided to publish it here. I am fairly certain that progress has been made with both x264 and WebP's encoders since then, and will write up another comparison when I have the time.
JPEG has had incredible staying power as an image compression format. Originally ratified as a standard in 1992, JPEG saw widespread use across the world wide web, as early internet connections were low-bandwidth and loading webpages could take over a minute. As technology has progressed, formats for other forms of compression (generic data, video, and audio) have improved, but the compression of JPEG has been "good enough" that people only started to make efforts to replace it in the late 2000s.
One of the main contenders for dethroning JPEG, WebP, is now taking off, with Chrome now supporting decoding of .webp files natively. WebP is based upon the video codec VP8, which is commonly used in the .webm container for internet video.