As commented by canonacer, in most cases, airlines are required to check whether passengers are allowed prima facie to enter the destination country. If they fly someone to the destination, and they get denied entry, the airline may be fined, and will have to carry the passenger back on their dime.
So they have every reason to check that the passenger has either a passport that allows entry without a visa, or that they have a valid passport and the relevant visa.
Documentation can only be verified at the check-in desk for those that use it. Passengers with no checked luggage, or which use automated bag drops (not sure if those exist for Swiss in ZRH?) will not see an airline employee until they reach the gate.
Checks at passport control (by a border guard) are only for exiting the Schengen Area / Switzerland, they don't care if you are allowed in the destination country (they usually don't care at all where you go, actually).
So the only point where travel documents can be checked by the airline (or a third party doing it for them) for all passengers is at the gate.
For some destination countries, passengers have to enter information online in advance (Advance Passenger Information, or API / APIS), which may simplify things at the gate (just have the check that the documents match what was entered, not that the documents actually allow entry, as that should have been determined automatically earlier).
Depending on the mix of citizenships usually observed by the airline, they may know that most passengers are easy to check (just checking the passport is enough), or that it's often more complex (visas need to be checked), in which case they may set up a specific procedure for this.