Let me give a concrete example here, direct from experience.
Florida DOC mandates you must do 85% of your prison (not jail...all jails have different gain time schemes just to make it really confusing) sentence, so that is roughly 5 days a month.
Lets say you score out to 22 months like I was many years ago...thats a total of 110 potential gain-time days off my sentence...great I think almost 4 months!
BUT...let's say I did 13 months in jail waiting for sentencing so I only have to do 9 more in prison.
In most prison systems, I would NOT be able to recover all my potential gain-time because the 13 months county-time did not count for my prison gain time, and perhaps I would only get 9*5 or 45 days gain-time against my sentence.
Get it?