Is the company not losing money?
Of course not. Your credit card company is betting that you will carry a balance on your card. As of September 2021, over 40% of American credit card accounts keep a balance each month (generally called "revolvers") and about 33% of American credit card accounts pay off their balance every month (called "transactors", source). About 25% of American credit card accounts are unused (and called "dormant"). The average credit card account keeping a balance has a balance of $5,525. With an average interest rate of 17.48%, this means that the credit card company is expecting to earn $80.48 per month, of which you might "reduce" by up to $25 in "cash back".
Presuming that all credit card users earn the max cash back, the credit company expects transactors to cost $25/month and revolvers to earn (for the bank) $80.48/month. Expected bank income from transactors is 33% * -$25 = -$8.25/month. Expected bank income from revolvers is 40% * (-$25 + $80.48) = $22.19 per month. Your credit card company can expect to make a profit of $13.94 per customer per month. This does not include merchant charges, late fees, annual fees or any other fees.
In short, while you might make $25 this month, and maybe next month as well, your credit card company is betting that you're going to slip up and start carrying a balance on your card and you're going to pay them far more than you "made". They have the historical data to show that they're in the much stronger position than you are. Typically, when people start carrying a balance on their credit cards, they carry those balances for decades. Anecdotally, I've had some co-workers who have carried large balances on credit cards from their 20s until retirement making only minimum payments their working lifetime. I personally stay away from credit cards. After a prolonged unemployed period in my early 40s, I have gone out of my way to be as debt-free as possible, with only car loans, student loans (from earlier years) and home mortgages since then.