Being named captain is an honor in team sports. But coaches don't name their captains based only on how well a player performs during the game. There are various other factors that coaches use to weigh who they choose as captains, from how players handle themselves away from the game to the level of respect they receive from their teammates.
Team captains are used to motivate players in ways that coaches cannot. Because of this, not only do captains need to show natural leadership, they also need to command respect from their teammates. For example, Steve Yzerman captained the National Hockey League's Detroit Red Wings for 19 years. Not only was he one of the team's best offensive players over this span, but he changed his game to become better defensively to help the team win more games. Team captains need to put the team before themselves, and unlike coaches, they can lead this way by showing it in the game.
Whether it be high school, college or professional sports, one factor that coaches use to name their team captain is experience. Since captains often lead by example, coaches often select captains who are upperclassmen or veterans. These players are more tenured and can teach the younger players how to be effective, both in playing the sport and within the community. Coaches often select veterans as captains so they can act as mentors.
Aside from leading a team, captains have other responsibilities. They are the voice of their team in game situations and speak with referees to sort out penalties or infractions and voice other in-game concerns. They're also responsible for representing the team within the community. For example, when Drew Miller was the captain of Michigan State University's ice hockey team in 2006, he visited sick children in the hospital, using his status to positively impact the community.
Part of a captain's responsibility is knowing when to get in a teammate's face about poor play. For example, it's one thing if the coach voices displeasure with a player's game, but it's a whole different motivating factor if the team captain also speaks to the player about the problem because it's coming from a peer. It's the role of the team captain to often tell his teammates things they don't want to hear, but need to hear. If done correctly, it can be a motivating factor for the team.