When md's finish their residencies, do most of them stay at the hospital to further establish themselves or do they work for another private office?

Most stay local. Most new docs practice within about 50 miles of where they completed their residencies. This is why lots of remote places are starting new residency programs, to "grow" some local docs. This creates some exciting training opportunities and provides access to health care for under-served communities.
Depends. Most docs stay in the area, though not at same hospital. This is due to having settled, spouses with jobs, etc. Also hospital's network is strongest nearby. Some choose to further specialize with fellowships, which may be at same or far off hospital. In this economy, new docs are just trying to find any work to help pay student loans.
MOST 'move on' Most physicians (M.D., D.O.'s) join an existing medical group (not hospital based per se) or less likely they go into solo private practice. Some physicians continue their training in a 'fellowship' then join a practice. Only a few doctors have a totally hospital based practice e.g. 'hospitalists'.
MDs and DOs. Usually select a residency based on many things, location may be one. Where it ranks in the list of requirements depends on the individual. A particular residency may be one of few places that teaches something unique or in a different way. It may also depend on the residents. I believe most residencies prefer grads stay in the area. In priv. Pract. You can still affiliate with the hospital.