Here's how this happens: For example, take a case where the judge rules that parent 'A' is to have temporary custody until the case is heard. The court date is 6 months away and during that time the children are with parent 'A' most of the time. When the case comes to trial (or settlement), the judge will normally state that since the children have been with parent 'A' for the last 6 months, they now have an "established custodial environment". The judge will be reluctant to change the status quo at this point, and as a result the children will remain with parent 'A'.
The longer the 'temporary' orders are in effect, the more likely it is that they will become permanent. The example date above of 6 months is optimistic; court dates set 9 to 12 months out from the date of filing are not uncommon.
"Temporary" is one of the most misleading words used in the divorce and custody arena. Never agree to anything in a "temporary" hearing that you wouldn't want made permanent, because that's usually what happens.