The closest answer you will find to the exact question you asked is: that feature does not exist, WordPress does not have an image compression feature.
That's not how compression works, compression isn't something WP does. Your understanding of how WordPress handles image uploads, and your expectations, are incorrect.
WP does not store images in the database, they're stored on the file system and represented by a post of type attachment
.
WP also preserves the original uploaded file unmodified, it is only the additional image sizes that are created, and because they are JPEG's you need to specify a compression value when they're created. This is usually the "full
" image size, and it is always kept. Without this, it would be impossible to regenerate thumbnails if their dimensions were changed, or add new image sizes for already uploaded items.
So there is no compression step, it's just a side effect of the creation of these additional image size files, not a dedicated feature or step.
If your images dimensions are too small to create these image sizes then no new image sizes are created as that would require upscaling.
Additionally, if your image consumes too much memory to decompress and modify then image sizes can't be created.
For this reason, this sentence makes no sense:
Please, tell me how to change this setting so that all image sizes are compressed.
There is no such setting, that's not how image sizes work. There is a filter to change the percentage, but the default is 70%, so it will not enable compression as you are hoping. Compression is not something that is enabled or disabled, that's just not how image uploads work in WordPress.