By far the largest component of credit card processing fees is interchange fees. These are set by the card networks (Visa, Mastercard, etc), and fluctuate depending on many variables such as whether the card is present for the transaction, the card type, the number of transactions the merchant accepts, and many more.
To put this into perspective, Visa published their interchange fee structure for April of 2022. The document is
26 pages long. To say it's complicated would be an understatement.
In general, the more secure the transaction, the cheaper the interchange fee is. High-rewards commercial and corporate cards tend to incur larger interchange fees, while debit cards have a relatively low fee.