It was their authors choice first and foremost to publish them as OSS
There is no legal obligation per-se. Open Source is a charity, but you can understand a lot about a company's motives if you compare their FOSS usage to their FOSS contributions.
Goodwill might work for individual contributors, but it’s not enough of an incentive for organizations.
It _should_ be. There's nothing stopping organizations from doing good things except expectation.
There are real costs and that has real consequences. Expectation is way down on the list.
It’s clearly not perfect calculus since so many defect from OSS, but there’s also clearly some business sense there.
Then it just transitions to a charity that everyone relies on. It's been embarrassingly difficult for people to admit this vis-a-vis Linux and the like, but it's obvious in a situation like programming languages. We rely on the enduring charity of it's authors, license-holders and distributors to write and distribute software.
"Giving back" is not an inherently cynical process. Meta has no obligation to publish these patches in the first place, much less work as a part of the community to solve a common issue. But they do, and it's just kinda part of their culture at this point. Yes, they do still gain from it; but so do their direct competitors. It's difficult to characterize as a purely business-motivated decision, because there are much greedier avenues to pursue if that's their MO.