Storing every single pixel requires a huge amount of space. Compression looks for patterns. For example, instead of storing 1000 black dots in a row, it is much shorter to store a note that says 1000 black dots come next.
The JPEG standard supports lossy compression, which matches patterns if they are close—saving more space, but reducing quality.