For example, "pencils have a cap" means each pencil has a cap and a group of pencils has a cap? If so, how can I differenciate these two meaning naturally?????
Each of the pencils has a cap.
All of the pencils have a cap.
Note that "each of" is singular, but "all of" is plural. More information on which indefinite pronouns are singular and which are plural.