The Optimize iPhone Storage feature stores low resolution (Less Disk Space) photos on your iPhone while it stores full resolution (original file size) photos on iCloud.
Your screen shot shows the status of your iCloud storage. For 10,000 photos, 2.2GB storage space is low. What is happening is that your 10,000 original resolution photos are being uploaded to iCloud while converting them to low resolution on your iPhone. This way your disk space is optimized and will create some free space on your iPhone. There are 10,000 photos in all and it will take some time. Note that the process of uploading and converting will only continue while the iPhone is connected to electrical power AND a WiFi Network.
Axel F.