To augment Slayner's answer, I've made a quick example in Minecraft. The way hoppers work is that they prioritize a hopper below drawing the item down over moving the item along in the direction the hopper is facing. So, in this picture, the items traveling along the hopper chain will be sucked into the one below. Note the middle hopper is not pointing down - this is important, as the items must be pulled by the bottom hopper rather than pushed by the top hopper. The bottom hopper thus controls the flow of items, being controlled by the redstone torch below it.
To filter items, you must have all the slots in the hopper below the chain filled with the item you want to filter. The redstone makes it so that the hopper will hold 22 items, and when a 23rd item goes in, it will release one to the lowest hopper and into the chest.
If you need to sort items that stack to 16, you will need to change the amount in the hopper, because comparitors work on fractions of stacks rather than pure number of items (this also means you cannot sort unstackable items this way). Just put one of the 16-per-stack items in each hopper slot, like so:
Note that only the leftmost slot need contain the actual item being filtered. Therefore, the others can be filled with a block/item that you know will never enter the system. Also, this means that you may use items that stack to 16 in the other four slots, to reduce the number of items needed in the hopper. Renamed items, or non-sorted items such as eggs or snowballs work well. For sorting items that stack to 64, you need 4 items plus 6 of the item you are sorting (will try to remember to add a picture when I get home from work).
This design is tileable, meaning it can be stacked horizontally with no space in between (alternating between trapped and regular chests if below 1.13). There are other designs, and more complicated ways of sorting items, but this is the most common.
Best Answer
What I've found is that the sorters work best if you keep the placeholder blocks at 1 per slot, and increase the item you want to sort up to 41.
With the setup you're using, the redstone signal coming from the comparator can easily increase past the amount needed to open the hopper below. This makes it so that the hoppers on either side will open, dropping your placeholder blocks. If the signal from one of the sorters gets big enough, it will start a cascade effect through your sorters, and they'll all start dropping the placeholder blocks.