Nobody said Apple are doing it because they're are evil, calm down.
Your parent said Apple can afford to give you longer support because they not only make money when they sell you the phone HW, they also keep making money from your iCloud, iTunes and every other third party subscription or SW you buy on Apple App store. Basically, they double dip and monetize you over the entire period of you owning the device. That's exactly what your parent said. Apple's walled garden affords them enough revenue to keep funding SW updates for your old Apple devices which Android makers can't do.
All the other Android makers, apart from Google, don't make any other money after they sell you the phone HW, since Google is the one earning 30% off Playstore sales, not Samsung, or the others HW makers. Therefore they can't afford to pay teams of SW devs to keep pushing you SW updated for your old phone, so many years after you stopped giving them money, especially since they depend on Quallcomm and other semi vendors giving them up to date drivers, which they won't do for free since semi makers also want to sell newer chips rather than supporting older ones for free.
Google could do like Apple in theory, since they own the whole ecosystem stack apart from the SoC and they do have the cash for it, but they don't want to do it because Google sucks at maintaining anything "old" long-term, especially HW, so they keep doing what Google does best and focus on the new shiny while sunsetting the older shinys.
It's ironic that Samsung offers longer Andorid updates for their flagships S-series, than Google themselves do for the Pixels. That says everying about Google.