Paul F. Norris summarizes some recent research:
[C]himps laugh in response to the laughter of their playmates, that this laughter differs in acoustic form and timing from their spontaneous laughter, and that the purpose of their non-spontaneous laughter appears to be to prolong social play, promoting group cohesion and perhaps providing the chimps with important social advantages.
He looks at the science on rat laughing here.