In general, if everyone brought a dish large enough to serve everyone, there would be far too much food. Suppose you expect 20 people and there are 4 "slots" to make a meal, consisting of an appetizer, an entrée, a side, and a dessert. If each person brings a dish for 20 people, everyone could be served with only 4 people bringing a dish. If all 20 people bring a dish each for 20 people, you'll have enough food to serve 100 people, not 20! No one wants to see 80% of the food at their event go uneaten, so everyone bringing a dish big enough for everyone is not ideal.
With this in mind, it's usually acceptable to make a dish that won't serve absolutely everyone, so long as there are other options in the same category. You wouldn't want to be in charge of the sole entrée item and arrive without enough to feed everyone, for example. If you're bringing one of many desserts, on the other hand, you should be OK bringing just one reasonably sized cake or batch of cookies, even if not everyone will get a piece.
I've personally had luck with this approach at a large work event of perhaps 75 people. It would have been unreasonable for everyone to make a dish to serve 75, so I made a dish that could serve perhaps a couple of dozen people, and it seemed many people did the same. There was still lots of leftover food overall, and although some of the most popular dishes were finished, it would have been very hard to predict which ones those would be in advance.