Once upon a time, primary care physicians would take care of their patients at all times, in the hospital and without. However, with the increased pressure to see more and more patients in clinic, PCPs got less and less time to travel to the hospital and take care of the inpatient, who due to the acute nature of the illness that got him/her there, is very needy.
Thus, the hospitalist was born. Hospitalists provide a service in which a PCP can have a hospitalist cover their patients whenever they land in the hospital. During the time that the patient is in the hospital, the hospitalists will make all the medical decisions (in close contact with the PCP, who knows the patient the best). When the patient is discharged, the hospitalist "transfers care" back to the PCP, and is no longer involved.
There are pros and cons to the system. Pros: Hospitalists are trained to address inpatient problems since they see it all the time. On top of that, since they're always in the hospital (they don't have clinics), they're always available to see the patient immediately instead of having to travel across the city each time something comes up. It's also felt that in teaching hospitals, the hospitalists are in a better position to teach residents/students.
Cons: PCPs know their patients best, and the continuity of care is important. Hospitalists will never see their patients again once discharge occurs (unless there is a bounce back).
You'll find that older PCPs are very disdainful of the use of hospitalists because they strongly believe that no one can take better care of a patient than the PCP who knows the patient the best.
You'll also find that many residents like the hospitalist role because it's a familiar environment to them (they're still in the hospital all the time, taking care of inpatients).