How can just a little more than 100 elements combine in different ways to form a huge variety of compounds?

Answer:
The question itself contains the answer: they can combine in many different ways. Carbon is particularly good at this.
First answer by Ptorquemada. Last edit by Ptorquemada. Contributor trust: 551 [recommend contributor recommended]. Question popularity: 1 [recommend question].