Understanding team dynamics is one of the complex things that most of technical geeks feel left behind on.
In order to motivate your team you need to build high morale among the team members. As a team constitutes of few individuals that may have different personalities and can cause conflicts. In order to build high morale a leader should always allow a room for some conflict. A leader should not be worried about conflicts among the team as these are critical for evolution of a better team. This allows to build a corridor of communication that can be used by any unhappy employee or team member. As the team is now aware of an existence of such corridor this helps to break all mental walls and give the team members a feeling of comfort. And this is one of the key ingredients of high morale in a team.