Flash memory can't overwrite a 1 with a 0, or a 0 with a 1. It actually has a third, erased state which must be the intermediate step. 0 -> erased -> 1, or 1 -> erased -> 0. If you're an EE and have played with EEPROMs, same thing.
The erased -> 0/1 step is blazing fast, which is why SSDs are so much faster than HDDs.
The 0/1 -> erased step is slow, nearly as slow as a HDD (slower on some older SSDs). To counteract this slow step, SSDs will pre-erase deleted sectors while the drive is idle. This allows it to keep a buffer of pre-erased sectors read for lightning-fast writes. This is why TRIM was so important - it's how the OS told the SSD which sectors were safe to erase.
If you fill a SSD up to near capacity, it can't keep as many sectors pre-erased. It ends up having to erase sectors which have been freshly-deleted before it can write new data. This causes write speeds to drop to HDD-like speeds. Hence the recommendation to always keep about 10%-15% of the SSD empty - so there's room for it to pre-erase cells.
(Newer TLC SSDs also initially write data in SLC mode, then re-write it as TLC while the drive is idle. If the drive is full, there isn't enough space to write in SLC mode, and it ends up having to write directly to TLC mode.)
Great explenation, I could understand everything.
I have choked my SSD's for so many years, so what a waste of performance.. Wish i knew this.