Conflicts can happen even when fish labelled as 'peaceful' or 'community' are kept together. To understand why, it is important to look at a fishes real nature
Fish are diverse creatures of habit; each species has its own typical response to its environment, and its own set of social rules. It is more often than not that those social rules cross boundaries, with the community of the aquarium suffering as a result. OK, so it would be daft to mix say, large predatory Oscars, with some guppies, but that is not what I am getting at. What about the habits of more peaceful fish such as swordtails, dwarf Gouramies, platies, tetras, and the aforementioned guppy? These are all labelled as 'community fish' so they should all get along fine, but the situation is more complicated than that. Much like a fight often erupts after two many bevies in the average town, keeping such different, or similar, fish together in a confined space will sooner or later result in conflict.
As usual, it is the males that are at fault in many cases of unsocial behaviour! The primary mission of any animal is to reproduce, to pass on its genes to the next generation. For the animal to evolve in the best possible way, natural selection ensures that only the strongest, fastest etc. passes on those genes, thereby ensuring the species remains strong and any unhelpful random mutations are kept out of the gene pool. The male of many species has a constant battle to ensure that it remains the best pick of the bunch, in order to attract females willing to reproduce. Males often do this by showing their superior strength and agility and chasing away any other males, ensuring they have access to all the females and that no interlopers sneak in and pass on their genes.
In the aquarium, as the males of some species reach maturity, they will seek to become the pick of the bunch, and this is when the trouble starts. In the wild, a strong male that asserts its dominance by chasing away other males does exactly that; chases them away. The other male then has the choice to stay away, or challenge the fish for dominance. The winning option in this situation is to always back down until you know you can defeat your opponent, or get one over on them in some other way, and that is exactly what usually happens. In the aquarium, the option to stay away is not available and the dominant fish will see the other fish remaining within view as a challenger. The fish which is trying to get away has no option but to continually display submissive behaviour, meaning hiding away whenever possible and becoming a virtual recluse. This kind of behaviour and lifestyle is not healthy and the submissive fish will soon become thin, stressed and prone to disease.
The other side of the coin
Females, or course, can be equally as troublesome as males, and their attacks are often more focused. In the case of fish that pair up, such as kribensis, and even sailfin mollies, if a female considers a male as an unsuitable mate she will aggressively chase him away in order to make it clear he is not suitable. The same situation occurs with the dominant/submissive scenario whereby the submissive fish becomes weak and unhealthy. In this situation however, the pair can often be separated, and once the male has recovered and is well cared for, he will be a more enticing prospect when the two are reintroduced. This method is particularly successful when it is the aggressive female that is removed; when she is reintroduced she will be entering the males territory.
Protecting the brood
Fish which are good parents, i.e. they care for their eggs and young, can become a nightmare in a community aquarium. Angelfish are the typical example here, and many an aquarist has kept angelfish in a community tank for years, only to find they suddenly turn into vicious rulers of the aquarium. In order for a fish to protect its young, it must chase of any fish that may be capable of eating the eggs or young, and the instinct is so strong that the size of the opponent is usually of little concern. Not a lot can be done in these types of situation as the parent fish, still in breeding condition, will often continue to be aggressive even when the pair is separated. Careful planning of your community from the start is the only option, make sure the tank is large enough and the tankmates robust enough to cope with a territorial parent. Plenty of hiding spots and décor will provide escape areas and reduce the visual territorial boundaries of the fish.
It would be a reasonable assumption that fish that naturally live in groups should all live together peacefully, but most groups have complex social structures, which are often disrupted in the aquarium environment. In the case of some small tetras and barbs, the social structure is a hierarchy where the top male fish displays the best colours and gets to breed more often. Behind the 'Alpha male' are several subordinates which all have their own loosely defined place in the group. In order to reinforce everyone's position within the group, occasional fights will break out, normally between the more mature and dominant fish. If your shoal of danios, tetras, or barbs are fighting or squabbling every now and again, it is perfectly normal and no one is really being harmed. This whole social system relies on there being a group of fish, when the numbers are cut down to just a few, it breaks down and problems ensue. In a group, the dominant fish has plenty of would-be contenders to do occasional battle with, whilst the less mature and/or weaker fish can easily blend into the background and stay out of harms way. When there are only a couple of fish, the dominant one will be looking to assert its dominance on any others, which means its unlikely tankmate(s) may get the brunt of its aggression. A good example which many fishkeepers are aware of is the tiger barb, well known for being a nippy fish. If you exclude the really long finned fish such as guppies and male Siamese fighters, tiger barbs can be kept with almost anything of similar size, including fish with trailing 'feelers such as Gouramies, if they are kept in groups of ten or so. If only a couple are kept, then they will live up to their reputation and nip everything in site, being unable to exhibit natural group behaviour.
The age factor
I'm sure that many fishkeepers have seen a shop sales tank full of red tailed black sharks peacefully scavenging away amongst other red tails and other species with no apparent problems only to have their specimen turn into a violent bully. This is the difference between the young fish for sale and the fish that reaches maturity in your tank. For any small fish it is beneficial to be amongst other fish for protection and to help find food, so young fish like red tailed black sharks will naturally stick together and stay out of the bigger fishes way. Once you are a big fish however, anyone else in your vicinity might be trying to pinch your feeding ground, eat your eggs and young, or even steal your missus, so the best course of action might be to aggressively chase away any on comers until they get the message to stay away. Fish such as some South American cichlids, algae/sucking loaches, and of course, the red tail are typical culprits and although they may have particular enemies, are generally indiscriminate about who they chase. The solution with these fish is to keep them away from their own kind and only mix them with bigger or active and tough fish that will stand their ground.
The numbers game
Apart from the specifics, most fish like to let of a little steam every now and again, and will give the odd chase, nip, or butt to a fellow tankmate who wanders to close. Normally little harm is done, but a community aquarium can only be achieved by playing the numbers game. Generally speaking, livebearers such as guppies, mollies, swordtails and platies if kept in mixed sex groups should always be well outnumbered by females to prevent the females being harassed. Males, particularly swordtails and mollies, should either be kept singly or in numbers of four or more so that the dominant male can spread his aggression out. The same is true of male Gouramies, a male within a small group may become a bully, but a male within a larger group will simply keep the others on their toes. Shoaling fish like tetras should of course be kept in groups, the more the better. The best action to take to make sure all is peaceful is to simply watch and observe your fish, and note any aggressive behaviour. If a problem crops up it can usually be remedied by altering the numbers of the troublesome fish in question.