Ideally, once the kids are placed with a traditional foster family, they remain there until they move on to a permanent situation. The permanent situation would be either (a) moving home with their biological parent(s) (called "reunification"), or (b) moving to a pre-adoptive home. If a child's case starts heading towards adoption instead of reunification, the foster parents will usually have the first chance to adopt that child if they choose to do so (Is foster care a good path to adoption?).
The length of time that kids are in foster care varies depending mostly on what work is required of the biological parents, and how quickly they perform those tasks or how much they drag it out. It also depends on the lawyers, judges, and caseworkers and the decisions that they make along the way. Our agency told us to expect kids to be in foster care any length of time between 18 months and 5 years.
Like I said, ideally the kids remain in one foster home the entire time that they are in state custody. However, sometimes that doesn't work out and the kids are moved from one foster home to another temporary home. Here are some of the reasons why kids might be moved:
The foster parents can no longer provide care for the child due to a move; change in financial status (losing a job or other income); the foster parent faces a serious and/or long-term illness, injury, or disability; divorce; or any other major life change that compromises the foster parent's ability to care for the child.
The child's biological extended family becomes available to house and care for the child. When children first come into foster care a diligent search is done to locate any family that might be available and willing to care for the child. They are then screened quickly so that the kids can be moved there right away. But sometimes family members show up later, or a problem which initially ruled out a family member becomes resolved somewhere down the road, and the kids end up being moved after being with a foster family for some length of time.
A child's needs become too great for one family to meet requiring a move to a foster family with specialized training, or a move to a therapeutic group home.
The foster parents are found to be abusive or neglectful,requiring a move to a new foster home.
These unforeseen circumstances can occur at any point during that "18 months to 5 years" timeline. Sometimes you see it coming for quite some time and everyone has a lot of time to prepare for the transition, and sometimes it is very sudden.
And that, my friends, is what we call a very long answer to a very short question.