Strangely, I have not yet come across works in my sociology modules talking about the definition of a community, or any other social group!
What makes a community, why is a group of people a community rather a mere collection of people, is an interesting question, I think. Thinking about it now, Durkheim did try to provide definitions for what makes a society, and part of his response has to do with the notions of interdependence and solidarity. The only other work that I've come across that is directly related to this topic of community is the study of social networks.
The main point is that communities require people to enter into non-obligatory relationships and interactions. To be in a community is to be in interaction with other people, to be involved in the lives of others. Unless people genuinely commit themselves to the social and physical environment (yes, physical location matters as well!), initiatives about community, about cohesion are simply moot.
A lot of what I write about community also stems from my participation in an actual community.
A community is the result of social interactions sustained over time. As long as there are people coming together, and greet, and talk, and share with one another over a period of time, a community seems to form, based on the exchanges that occur. Note that in all of these, there are no ties of obligations. People are free to enter or leave in these exchanges.
Why then, relationships?
At a functional level, the creation of relationships are important for the psychological and social needs we possess as human beings. There really might not be all that much to it, really. More than that, in the creation of these relationships we find meaning, and synergies with others to converge on projects.
Then the conflict comes in…
The conflict comes in when given limited resources, deliberate efforts are made to improve the material and social conditions of this community. Social events are organised, all for mutual benefit. Having gone through many such events, everyone is supposedly more well off in terms of the aesthetic experience and the overall "utility" gained.
And then, there are different interests in the community, and eventually politics enters into the picture as potentially different groups negotiate for the limited resources, or competing for their own vision of things to borne out.
Politics in inevitable, I suppose, although it presupposes the community to exist in the first place.