Harbaugh is a born leader of men. He walked in the door, told the fucked-up Niners locker room to get their heads of their asses or they'd be kicked off the team. Probably threw some trash cans around like a drill sergeant too.
Players were like "yes sir, coach." Instant leadership, the players pulled together, because a T-E-A-M and started winning games.
Alex Smith, woeful career QB rating of 67.2 prior to Harbaugh. Coach Harbaugh arrived to teach Smith how to approach the QB position, BOOM instantly Smith has a QB rating of 97.4 for his (almost) 2 years under Harbaugh's leadership.
Every NFL team has talent...the players would not be in the NFL otherwise. Only the well-coached teams are taught how to be winners.