Many companies (including Facebook) tried to beat Google's search algorithm, they all failed (except for Bing which seems to be used by some). Unless someone can make a search engine that is much better than Google, they will keep being successful.
Same for an ad network. If you have a website, using Google for ads seems to be the best option so far. No one is really happy with Google, but they still seem to be better than most competitors.
I'm not sure how much Facebook tried, but searching within the Facebook platform is a really bad experience. It's as if many things are either not indexed or are indexed with only selected sentences or words from the content. I struggle so many times to find older content for reference and to point people to, and fail a lot more times than I succeed (I mostly search in groups). Since Facebook thrives on people wanting new content and clicks, it doesn't seem like it's in Facebook's interest to make searching within the platform better. From whatever I've seen over the last several years, if at all Facebook has been working on search, the engineering team is utterly incompetent on that front.
Wikipedia with some background: https://en.wikipedia.org/wiki/Facebook_Graph_Search