Having popular, high-profile open source projects helps Facebook attract more and better talent in three primary ways:
First, it increases the likelihood that the average programmer already is familiar with the tools they'd use at Facebook. It's useful for them to be able to hire people who already know React, Reason, etc. On occasion, they'll manage to find highly talented developers who either contribute to their projects or build useful related projects, and then they can make those people an offer. Even better, sometimes that's an entire startup they can acquihire.
Second, it increases the prestige of a job at Facebook. Most of the core public functionality of Facebook isn't particularly interesting to me, for example, but the stuff they're doing with OCaml is. The chance of me working there is still essentially nil but it's definitely less nil than it would be if I didn't know about projects like that.
Third, it gives them something really valuable to offer skilled devs -- the ability to become widely known and respected for your contributions to a popular open source project. That's worth a great deal to some people.