I doubt that any transaction costs some percentage of the transaction's value. The true cost shouldn't differ whether I charge $1 or $10 (maybe large transactions incur extra costs for security measures). It's just a convenient way of pricing for the credit card company.
Many of the entities that process transactions do fraud monitoring. Oftentimes, the fraud monitoring has different levels of time spent depending on amount: under $10 and the system just ignores it, under $1000 and a computer uses some heuristics, and above that, it might be flagged for human review. These aren't exactly 5% of the cost of the transaction, but they do show that the cost to process the transaction does increase as the amount increases, and fraud prevention, detection, and responsibility is how companies justify charging a percentage on a transaction.
That's pricing in the risk of taking the charge. The $10 transaction is 10x as risky to a credit network's bottom line as the $1 transaction. That's also why the debit percentage is lower.