Your community will only succeed if it is providing something that your visitors need. Therefore, some degree of psychological insight is a core competency for running an online community.
I already described some of the technological techniques you can use to bring visitors back to your community (Part One); this post goes deeper, into the human emotions and motivations that make visitors stay, or return again and again.
The personal development/life coach Tony Robbins says that humans have six needs (apologies to Maslow):
We, as community administrators or managers, can keep these in mind as we try to connect with our audiences.
This need is best satisfied by making the community welcoming and comfortable. Establishing some routines can feed this need, like recurring events or games. The person who craves certainty will want to be included early on potential changes to the community as well. Sharing your blog's editorial calendar can be a decision that provides certainty.
This is one of the easier needs to fill. We already discussed how important it is to have fresh content, and offering different types of content will support the need for variety. Allowing different groups within the larger community will also provide an outlet for people who want varied human connections. Refresh the look and feel of your community from time to time, with tweaked colors or formatting.
Here's where the badges, special titles, and tiered membership come in. Your members need to feel as if they are a unique and special part of the community. It has to do with ego, but not in the negative sense; humans need to be needed, and they need to feel important. Focus community building efforts on the people, not the brand or the administrator. Find a way to highlight individual members of the community by quoting their comments or showing their picture on the front page.
Encourage your members to connect with each other. Private messaging, social sharing, and voting mechanisms can support ties among community members. Give them space to talk off-topic, and share things about themselves that will foster deeper connections. That's why often the most popular thread in a forum is the "share pictures of your pet" topic.
If a community stagnates, it will slowly become unattractive even to long-term members. Everyone likes to feel a sense of moving toward something, whether it's a milestone in membership numbers, holding new events like a live chat, or working toward a charitable goal together. Keep your members informed about progress via newsletter or announcements, and cheer when goals are reached.
This one ties to significance as well. You must find a way to let members feel that they are contributing something to the community. It can be as simple as letting them guest blog, share photos or videos, or make suggestions about your service or product. If you're crowdsourcing with your community, be sure to circle back and let them know when their ideas are implemented. Another way to recognize contribution is to "deputize" power users as moderators. The trust that this requires can be a strong motivator for members to keep contributing.
Bonus video - Since I mentioned Tony Robbins, here's an excellent TED talk he gave a few years ago about what drives humans; it's worth a watch from the perspective of a community manager, trying to figure out what makes people decide to join, and then decide to invest their energy in the long term. You want to help people find meaning in your community, and add it to their resource kit. (WARNING: there are a few salty phrases in this talk.)