Most pictures taken on digital cameras are stored in JPEG (or also called JPG) format.
The camera can shoot pictures in a certain resolution like 6 megapixel and if the camera stored the picture as it saw it like that it would take about 6 million bytes (which is what a raw image or tif does). However we really don't need that big for several reasons so jpg.
The first reason for jpg is that it is smaller, but still quality so will travel in less time across networks and the Internet. The second is the size being stored. There is limited space on people's computers to store files so if compressed we can put more on the disk. This one is less an issue currently as disks have gotten so large and cheap but space limited on phones etc.
Now for the problem with JPEG files. When we compress them they lose some quality. It is not much but is a little. Basically there are algorithms (mathematical formulas) that are used on the characters that represent all the points in the picture (a picture on the computer is just a bunch of little dots (called pixels) and it notes which ones repeat and ones almost same as others and then just remember number of times on each. That is the process simplified but basic.
Usually when you look at an original jpg picture unless blown up to much, it is fine. However when you edit a picture it is uncompressed and then recompressed when it is saved. If you edit the edited picture the quality starts going. It is like making copies of copies (remember what happened in cloning in Multiplicity). If you are editing pictures keep the original as a unique name and then keep edited as different name and go back to original to do edits.