The CC transaction fee is generally about half of that. A normal sized restaurant will have their own merchant accounts for CC transactions and not pay the POS provider any percentage.
That's just one POS system, with a very unfavorable price. Most restaurants of medium size and up will not pay high rates like that on their transactions. If you have a merchant account you negotiate rates with your bank (or other account provider). The POS just connects with that. And yes, these POS systems are an expensive one-time purchase, with some yearly or monthly fees. However much more economical than paying on transactions.
If you're a smaller actor, there are POS systems that make their money on your transactions, but even among those Clover is a really bad deal. Compare to Zettle for example, that comes with a POS system, has no monthly costs and a flat 1.75% fee: https://www.zettle.com/gb/pricing