Encopresis refers to lack of control over one's bowels. Generally it is not used to talk about acute conditions like diarrhaea due to illness, but rather to a chronic behavior involving passing stool at inappropriate times or places. It also does not apply to young children who have not been toilet-trained, but only to ones over four years of age (this is the arbitrary cutoff chosen by the medical profession). In other words, for an act of inappropriate defecation to be coded as encopresis, it should be clear that the subject has the physical capacity for control, and is lacking in training or desire. Otherwise, the proper term is incontinence.

Nearly all cases of encopresis occur in young children. Many stem from inadequate toilet-training. Of course, children will have widely varying requirements in this area, so this is not to say that the child's parents or caretakers are themselves inadequate or culpable. Suggestions for treatment and prevention involve not beginning toilet training at too young an age and never punishing the child for "accidents," which will lead to negative assocaitions with defecation and make it more difficult for them to discuss it and learn to handle it appropriately.
Another potential contribution to encopresis is, paradoxically, constipation. Children who experience pain passing stool will end up trying to hold it, and possibly losing control. This can be treated in the short-term by administering small doses of laxatives that empty the colon before the fecal matter is compacted. Long-term treatments are essentially the same as those for adults: the child should drink more water and eat more fiber (insoluble fiber, specifically). Even though this increases the size of the stool, it also softens it so that it can pass more easily.

An interesting anthropological note: For humans, the only appropriate time to defecate is when one is sitting or squatting in one of a very few narrowly-defined places, such as a toilet, outhouse, or specifically-designated pit. Often, it is a mistake to pathologize behavior that violates such restrictive guidelines, when it may merely be a sign that a person is from a different culture, or otherwise thinks differently. However, people of almost all nations and eras have noticed the danger of having excrement lying around, and taken steps to separate and dispose of it, hence the old saying "don't shit where you eat". Thus, encopresis -- if not a disease in the same sense as cholera -- can legitimately be classified as a real problem and not a harmless personal difference.

An interesting etymological note: encopresis shares its prefix with the more common enuresis, or loss of bladder control. The prefix en- means "to make" or "to cause to do." The root meaning "defecation" can be seen most clearly in the english words coprolite and coprophilia.