There is no hard-and-fast answer, because removal becomes more aggressive as available storage space on the iPhone drops - the less available storage there is, the more aggressive the removal will be.
You might say the "cache is cleared", but to me that term is more appropriate for temporary caching (buffering for active upload/download, undelete/crash recovery, etc.) - to me "clearing" deletes the entire contents of the cache (like the caches that are deleted during a Mac's Safe Boot) - that doesn't happen with iCloud Photos; library contents are managed on an item-by-item basis.
To give you one person's example of Optimize Storage behavior - my 64 GB iPhone has 18 GB Available storage. 3.6 GB is utilized by Photos (which includes the full library of thumbnail images along with whatever full-quality images are currently on-device). However, I have 104 GB of images up in the cloud. (My 128 GB iPad is using just 2.8 GB for on-device Photos storage, yet it has 70 GB of Available storage.)
There's a substantial number of other iOS and Mac apps that behave in ways similar to Optimize Storage. The Music app is a prime example. Not only can you choose whether to permanently download songs vs. stream them, but there's an Optimize Storage option at Settings > Music where you can choose the size of the on-device library. Settings > App Store > Offload Unused Apps. iCloud Drive and Notes manage things automatically, with no options. If you use Messages in iCloud the on-device storage will also be automatically managed (individual messages removed from the device if they go un-read for an extended time, re-downloaded if/when accessed again). IMAP mail accounts are similarly managed - headers will remain on-device, message text re-downloaded as required.
And there are probably plenty of other examples, including third-party apps - on-device storage can be very limited, user data just keeps growing and growing.