By default, ewww-image-optimizer removes nothing from images.
If you check the remove metadata option, it removes everything that isn’t image data from the image. As it says on the settings page, this includes any embedded comments, EXIF data (camera information), and copyright information. That is not an exhaustive list, because you can store just about anything in the metadata. Photoshop can even embed a thumbnail of the image inside the metadata.
As for the actual optimization, all optimizations are lossless (not a single pixel is changed), because it simply re-encodes the data more efficiently. In the case of jpegs, this simply means using the standard Huffman encoding which many cameras and software skip by default. It also checks to see which is more efficient, the progressive or non-progressive jpeg format, and uses the best one.
PNG encoding is much more complicated, and if you really want more detail, you are best off going to the optipng homepage.
You can also visit the gifsicle homepage if you are interested in what gifsicle does.