Suppose any one of these things happened and suddenly Facebook wished that it had access to state of the art models so that it could customize them for its uses (internal developers or tools, embedding in their app).
Imagine how they would feel if the only way they could access these models were by signing 7-9 figure deals with a model dealer like OpenAI. Even worse, imagine if one of their main competitors in advertising started providing robust AI tools to help advertisers adapt their creatives to various form factors. Facebook is now way behind and possibly has to shell out millions to a company like OpenAI all while also losing ad market share worth billions per quarter (ads on Google start performing much better, so Google gets more ad spend)
If this worst case scenario came to pass, Facebook would look foolish. If even one of these things were likely their investments make sense. The rest (open source, make meta a cool place to work) are a strategy credit.
FB sells ad space on several apps. those apps needs people on them in order for the ad space to be worth anything. people, in turn, need content to attract them to the apps. so it's simple: enable people/companies/whomever to generate tons of content for cheap and consequently share it on the apps. that's it.
So that’s not it. Naively so.
• Tesla gave away its EV patents.
• Pixar and DreamWorks have both open-sourced some of their tools, including tools used to make some of their best works. For example DreamWorks' MoonRay renderer has been used on everything they have done since "How to Train Your Dragon: The Hidden World", including "Puss in Boots: The Last Wish" and "The Wild Robot", and will be used on their upcoming films.
• Facebook open-sourced React.
• Google open-sourced Chromium.
A better answer is meta releases them for some combination of they see it benefitting the business and/or a desire to provide broad benefits to everyone. They certainly expend tremendous resources to create these models. No other company has provided this much value to such a large base of users in this space.