“Project Nim,” a new documentary by James Marsh, is a probing, unsettling study of primate behavior, focusing on the complex dynamics of power, sex and group bonding in a species whose startling capacity for selfishness and aggression is offset by occasional displays of intelligence and compassion.

The movie also features a chimpanzee.

His name — a human imposition, like everything else in this creature’s remarkable, heartbreaking life — is Nim Chimpsky. In the 1970s he enjoyed (or endured) a season of fame as a research subject. Shortly after his birth at an Oklahoma laboratory, Nim was taken from his mother’s side and delivered to New York, where he became part of an experiment, led by a Columbia professor, Herbert Terrace, to determine whether an ape could be taught human language.

It is a bit curious that Mr. Marsh’s film has nothing to say about the roots of Nim’s name, a jab at the influential linguist Noam Chomsky, whose theories about the innateness and uniqueness of language to humans were the implicit target of Dr. Terrace’s work. His project was an effort to discern if a chimpanzee could learn sign language and if that learning could proceed beyond the mimicry of specific gestures into the creation of grammatical sentences. If Nim could be raised more or less as a human child, and could master human communication, that would challenge the Chomskyan idea of language as a special, hard-wired trait fundamentally separating us from other animals. (Koko the gorilla, another celebrated signing ape born around the same time as Nim, also tested this hypothesis.)

“Project Nim” glances briefly at the scientific controversy that shaped Nim’s fate, but Mr. Marsh is less interested in comparatively dry matters of linguistics or neurobiology than in a humid, messy domain of identity and emotion that has, in the past, been the terrain of psychoanalysis. And of literature: Nim, thrown from one home to another, vulnerable to cruelty and neglect and dependent on the kindness of strangers, resembles the titular hero of a Dickens novel, an orphan buffeted by circumstances whose biography is also a fable of individual virtue and social injustice.