It adds richness, deeper flavor, and umami. The chocolate makes the ground chiles and other spices perk up and taste more like themselves. The trick is to add only enough cocoa to make the chili taste better, not so much that it overwhelms the other ingredients or turns the chili into chocolate soup.
What kind of beer is best in chili? I almost always use a lager, porter or stout beer. These three types of beers tend to be a little lower on the hop scale and they have a more rich and frothy feel, which in turn makes the chili nice and hearty.
Beer is an essential ingredient in making a good chili. You don't have to be a beer drinker to use it in chili. It adds flavor and texture to the chili. Beer will impart sugars and malty flavors to the chili that you won't find with other ingredients.