How to add a modifier to a collection?
You have to join the objects together and then apply the modifier and then you can separate by loose parts.
Or

Add the modifier to one object.
Select all the other objects and then the one with modifier last.
Then Ctrl+L to copy modifiers to all selected objects.