It would be easy to look at Facebook’s recent acquisition of the start-up Masquerade and scratch your head. Why, you might wonder, would a company worth roughly $300 billion dollars want to buy a company dedicated solely to putting goofy animations over people’s selfies?

But the answer is there if you look at how Facebook has evolved over the years. The social media network is dominant, but it’s also in a constant battle to be cool — or at least just cool enough to stay relevant without being confusing for the older people on the network. Snapchat can make a whole business basically designed to confuse most people over the age of 25, but Facebook’s audience doesn’t allow for that. Facebook may have started as a social network for college students, but those people are now in their 30s. And they’ve brought their parents to the party.

That’s worked out for Facebook, which has turned its broad base of users into a gold mine. But that doesn’t mean, however, that Facebook has resigned itself completely to being a social network for (relatively)old people. It’s proven through a series of acquisitions and experiments of its own that it’s looking closely at the competition to stay as relevant as it can.

Sometimes those experiments don’t succeed, which happened when Facebook tried to make its own version of Snapchat — Slingshot, remember? No? — and looked like it was a little desperate. What has worked, however, is acquiring companies that complement Facebook’s audience and its own functions. Facebook’s acquisitions of Instagram and WhatsApp are the prime examples of this. Both have been a good way for Facebook to infuse its brand with something new, without having to invest too much in a copycat product. The fact that Facebook has more or less let both companies continue to run on their own post-acquisition also helps those products retain their audiences. Panic that Facebook’s acquisition would dramatically change the culture of Instagram, for example, has largely subsided.

In that context, the Masquerade buy makes more sense, particularly because it lets Facebook take another step to go after a prime competitor for users: Snapchat.

In addition to being the one that got away for Facebook, Snapchat is an undeniable force with which Facebook must reckon. Snapchat sits at the center of several social media trends that are pretty important right now — photo-based messaging, popularity among teens, personalization and a more mobile mindset.

Does Masquerade make Facebook a Snapchat killer? No, obviously not. But it does help the company take a small piece of the goofy, loose and completely shareable part of Snapchat’s culture and incorporate it into its own massive social network. It gives it just a little bit of something new, and keeps it just in step with the most current culture — which is just what Facebook wants. In addition to buying Masquerade, for example, this week Facebook also patented an algorithm that is aimed at detecting slang words its users type to put into a social glossary — perhaps, reports said, for the hippest auto-correct feature ever.

Facebook’s pursuit of cool, however, must walk a fine line. If Facebook did use its glossary to suggest slang terms, it runs the risk of alienating parts of its audience by being too ahead of the curve, said Kirsty Waller, senior vice president at SDL, an online translation service. “If Facebook gets the prediction wrong, users will feel like the platform doesn’t understand them, which can be off-putting.”

With the Masquerade features, however, Facebook may face the opposite problem: Once you pull something into the mainstream, it can lose its appeal. Now that everyone — your fifth-grade teacher and your grandparents — will also be using filters to turn themselves into zombies or to face-swap with their cats, it may lose any semblance of cool.