They did a full motherboard and keyboard replacement of my 2016 MacBook last year for no cost even though it was wwaaaayyyy out of warranty because the fault was a known issue.
Oh yeah, I remember they did a free out of warranty replacement on one of my MacBooks a bit back, but there was a potential battery explosion issue on that one.
I've been pretty anti-Apple for a long time. Look me up, I've been using the same handle forever, and I'm sure I've talked shit about it publicly over the decades. I've always lamented their proprietary connectors and formats, the premium they charge, and perhaps worst of all, their seemingly mindless fans. I've been using Microsoft as my daily driver OS since moving away from a TI-99/4A.
When I changed jobs in late 2020, I got to keep the 2015 Macbook Pro that I used for work. I'd been using a Mac since the company switched to Ruby on Rails, while continuing to run a Windows machine for things like gaming, video editing, Photoshop, etc.
By 2021, the battery on this 2015 Macbook Pro was noticeably swelling. I decided to try my luck, and took it to the Apple Store in Philadelphia, where they looked up the serial number, collected the machine, and a few days later, notified me that my battery had been replaced, free of charge. Because of the design of the MBP, this meant replacing the keyboard and all that surrounded it. Physically, it was like a new machine. This is on a machine that I hadn't even bought.
My understanding is that it's kind of a crap shoot. For known issues like the 2015 battery, there are typically windows of time when they'll fix the problem for free. I was well past that window. I was actually willing to pay for a battery replacement - until the debut of M1 architecture, the 2015 15" MBP was the best of the before-times - so I was pleasantly surprised that I got so much refurbishment for just showing up to the store.
They'll do free replacements if it's a known defect, and especially if it's widely experienced. Even Nintendo does that if they sniff a potential class action and want to avoid it.
Usually only after a very large public spat about how they are not being responsible for the problem. They have in the past denied problems that were widespread (board warp, keyboard, etc.) until either lawsuits or extreme push-back from the community - usually when they release a new product with those mistakes removed and it's impossible to deny them any more.
Painting Apple out to be a company that "does the right thing" without being forced to do so isn't accurate.
Even without that.
I won’t go into details, but they went out of their way quite a few times, without me having to pay a dime, and no defect whatsoever was involved.
Looking at the price estimator, battery service is like $250. That's not cheap.