Uncompressed (or even inappropriately compressed) images are generally too large to share without issues, especially on the internet where bandwidth is limited. Unlike video compression, where there are all sorts of codecs for all sorts of purposes, image compression mostly comes down to three ubiquitous and universally supported formats: PNG, JPEG, and GIF. PNG is considered to be a lossless format, while JPEG and GIF are said to be lossy, which is the part where compression artifacts start to appear.
The compression methods for GIF and PNG are rather simple. GIF defines a palette of 256 colors and draws the rest of the image with only those colors. The compression artifacts emerge when the palette isn't quite wide enough to paint everything, meaning the colors have to be interpolated to the nearest equivalent. PNG is essentially just an uncompressed bitmap compressed with gzip, which is why none of the original data is actually lost.
JPEG images go through a much more complex transformation that involves splitting the image into 8x8 pixel blocks and performing compression operations on those individual blocks as well as across all of them as if it were a lower resolution image. The process itself hasn't changed in a while mostly because it has proved to work extremely well on pictures and because further research has proved that there isn't a lot of room for improvement.