The fallacy of composition occurs when an arguer assumes that what is true of every part (or every member) of a whole can therefore be ascribed to the whole.
Here is a frivolous (and obviously fallacious) example:

1. Every member of the Los Angeles Lakers basketball team has a mother.
2. Therefore, the Los Angeles Lakers basketball team has a mother.
The problem here is that some characteristics of individuals in a set are not appropriate to that set on the whole. "Having a mother" is applicable to individuals but not to the entire team.
Here is a more subtle case, on a serious topic:

1. Every private jet creates way more pollution than a car.
2. Therefore, private jets on the whole create way more pollution than cars on the whole.
This overlooks the vast difference in the numbers of cars vs jets. There may be so many more cars than private jets that the conclusion doesn't hold. Because the conclusion does not follow necessarily from the premise, the inference is faulty -- we need more evidence than what has been presented.
Sometimes in this fallacy, the very expansion of a condition to the entire group is exactly what falsifies it.

1. If I pull my car off of this jammed freeway and take the side road, I will get where I am going faster.
2. Therefore, if all the cars on the freeway get off and take the side road, we will all get where we are going faster.
All the cars getting off and taking the side road would obviously jam up the side road (probably even worse than the freeway was).
The fallacy of composition can also involve negative statements about the individual parts of something that are untrue of the whole. Here is an example of that:

1. Water is made of H2O molecules, and each H2O molecule is not wet.
2. Therefore, water is not wet.
The problem here is that wetness is a function of how multiple molecules interact, and therefore is inapplicable to individual molecules.
A general template of the fallacy of composition would be:
1. Each individual element of the aggregate, W, has characteristic P.
2. Therefore, W has characteristic P.
Lakers Image Credit: Erik Drost under CC BY 2.0