Flanking in Civ 5 gives a 10% bonus to combat. In order to activate the Flanking bonus, move units onto tiles that are adjacent with each other and with the same enemy. Flanking stacks with the 10% bonus to combat in the Honor policy tree for units on adjacent tiles.
Flanking is also a critical part of taking cities without Siege units. A fully encircled city becomes very weak to attack mostly due to the flanking bonus. In the long run, the city will likely fall due to resource deprivation.
On the tactical level of two or three units, the use of flanking is universally a good thing. Since there are no area of effect weapons besides Nukes in the game, bunching up the units rarely backfires, and they can use the very important Medic promotion to heal each other, making them much harder to kill. Finally, two or three units have better firepower and can overwhelm even more advanced units.
Flank attacks may also be performed on a more strategic level as opposed to a tactical level. In the strategic sense, flanking is when one army uses fast units (mounted, paratroopers, helicopters) to go around the front line of powerful defenders to hit the weaker ranged units (archers, artillery, AA guns) that support the front. That would open the tough frontline units to attack from both the front and the back, if the strategy works.
This strategy can backfire explosively, especially when the commander ordering the flank has incomplete intelligence. If the other commander has only a few defensive units that are not visible, the whole attack will probably force the enemy into a costly rout, and possibly a counterattack. Even if the flanking commander does not encounter defensive units, if he does not destroy all or most of the ranged units in one turn, they will focus fire on the flanking units, probably destroying them. The strategy, like war itself, is risky.