Reminds me of the time I bought a package at a pawn shop, but didn't want one of the items in it. They said that to get a discount, I'd have to buy the whole thing as is then pawn back the unwanted item. So far, so good, but then I had to give my ID and attest that I didn't steal that one item ... even though they knew it never came from me to begin with!
[1] The way you said it, thousands sound like the typical case and $500 is a special deal.
Just adjusting the rate in their systems certainly doesn't cost the lender nearly $500 or $1000, but it was still a win-win. They got some money to offset the lower rate, and got to keep servicing the loan, and I got to pay less interest, it's been a while, but I seem to recall my break even was about 3 years each time. I would certainly consider the availability and price of rate modification when considering lenders in the future.
My lender had a program where you paid a nominal amount (originally $500, but later $1000) and they'll adjust your rate to their then current rate. If you do a full refi, my understanding is that's going to cost in the neighborhood of $3000, although many lenders will roll that into the loan, or otherwise hide it.
[1] https://www.nolo.com/legal-encyclopedia/when-are-prepayment-...