Workers speak in front of a booth at Facebook’s annual F8 developer conference in San Jose in April. The tech giant has shown a willingness to mimic the most successful features of rival companies’ apps. (Noah Berger/AP)

Four years ago, Facebook spent over $150 million on a free app used by millions.

Today that app, called Onavo, has become a little-known weapon in Facebook’s massive expansion strategy — helping the ­social-networking giant determine what is gaining popularity among consumers. It can then bring similar features to its own products, according to five people familiar with the effort who spoke on the condition of anonymity because it involves internal corporate strategy.

The Onavo app, called Onavo Protect, is what is known as a virtual private network, which means it disguises the traffic of smartphone users as they browse the Internet and use apps. But while it advertises itself to users as a way to “keep you and your data safe,” Facebook is able to glean detailed insights about what consumers are doing when they are not using the social network’s family of apps, which includes Facebook, Messenger, WhatsApp and Instagram.

The technology shows how far Facebook is willing to go as part of its aggressive strategy to reach into new areas beyond social networking, often by rapidly acting to mimic the most successful features of rival companies’ apps. Facebook did this most recently by replicating a key element of the Snapchat app. It also has done so for many other businesses, including a recent online fundraising tool, food delivery, offline meetups and its “On This Day” feature, which shows Facebook users pictures of what they did on the same day a year earlier.

Nobody has claimed that what Facebook is doing is illegal. But interviews with two dozen top investors and entrepreneurs suggest it is having a profound impact on innovation in Silicon Valley, by creating a strong disincentive for investors and start-ups to put money and effort into creating products Facebook might copy.

Mark Zuckerberg, chief executive officer and founder of Facebook, attends the annual Allen & Company Sun Valley Conference in July in Sun Valley, Idaho. (Drew Angerer/Getty Images)

“It’s what we did at Microsoft,” said Scott Sandell, managing partner of the prominent venture capital firm New Enterprise Associates, who was product manager for Microsoft’s Windows 95 until 1995. The Justice Department brought a landmark antitrust case against the company in 1998. “Whenever we saw a threat, boy, did we pounce on it.”

Facebook declined to comment but noted that roughly 100 million apps and businesses use Facebook’s developer tools or have a Facebook page that drives installations to apps.

Unease about Facebook’s influence comes when the balance of power in Silicon Valley has been shifting away from start-ups toward four dominant companies — Facebook, Apple, Amazon.com and Google.

With their app stores, Apple and Google — which recently was fined $2.7 billion by the European Union on antitrust concerns — are the gatekeepers for millions of new businesses. Forty-three percent of all online retail revenue now flows to Amazon, according to the market research firm Slice Intelligence. (Amazon chief executive Jeffrey P. Bezos owns The Washington Post.) And Facebook counts one-third of the world’s population in its monthly user base.

“The dominance of these companies is choking off the start-up world,” Roger McNamee, an early investor in Google and Facebook and founder of the investment firm Elevation Partners, said of the two companies. “I helped create a monster, and I regret it.”

Many in Silicon Valley say copying is fair game, arguing it is intrinsic to competition and to the history of U.S. business. While some academics have begun to question whether there needs to be new rules to limit the power of tech giants, almost no one in ­libertarian-leaning Silicon Valley thinks Facebook should be further regulated, with some saying it forces the best entrepreneurs to be more creative. Others point out that Facebook is nimble at copying but also frequently fails, leaving room for outsiders.

“They can predict the future as much as I can predict the future, and they can’t be right 100 percent of the time,” said Peter Pham, co-founder of the Los Angeles-based start-up studio Science.

Investors also now say they are eager to invest in closed networks that they think Facebook will not wade into — like social apps for distinct groups, such as health-care professionals — or ideas like blockchain, which would enable consumers to transfer their information without letting a large company become a hub of data.

Facebook’s use of Onavo is partly borne of need. Because Google and Apple, for instance, control the operating systems in which many apps live, they have access to huge amounts of information about how consumers use their apps. Facebook is more limited. It knows what consumers do within its own apps, and it knows about behavior on apps that work with Facebook — such as for sign-in credentials.

Onavo, on the other hand, helps Facebook’s expanding ambitions by offering near real-time access to information about what users do while Onavo is active in the background. Onavo sends anonymized data to Facebook on what apps consumers have installed, how frequently they open those apps, how long they linger inside them, and the sequence throughout the day of consumers’ app usage — information that functions as an early-detection system on whether an app is gaining popularity, according to the people familiar with the company’s activities. This information can be far more valuable, and be available earlier, than waiting for an app or feature to publicly take off.

Once Facebook detects a popular app, it can then quickly unleash a team of engineers that can swoop in to start building its own version, one person familiar with the strategy said.

‘Too close to the sun’

If Facebook once aimed to become the town square where people meet and share gossip, today it wants that proverbial town square to encompass many more commercial activities. When venture capitalists hear pitches from entrepreneurs, they say that one of the first questions they ask is how easy would it be for Facebook to copy the idea. It is increasingly the reason they decline to invest, according to interviews with over a dozen top investors, including Sequoia Capital and Union Square Ventures.

At Sequoia’s annual off-site retreat, held in March, skirting Google and Facebook were main topics of conversation, said Sequoia partner Alfred Lin.

“They have a chokehold on distribution,” Lin said in an interview.

Sandell said the growing dominance of giants, with Facebook being the most recent heavyweight, weighs on his choices.

“We don’t touch anything that comes too close to Facebook, Google or Amazon,” he said. “Which is to say, we don’t think our companies should fly too close to the sun.”

At the same time, Facebook has honed its internal organization toward spotting innovation — in ever more precise ways, according to the people familiar with the company’s strategy.

Onavo is one of many tools that Facebook uses. Consumers and developers use the free security app, built by an Israeli data analytics start-up, to look across their smartphone and help them reduce data use and monitor security threats. Before Facebook purchased the company in October 2013, Onavo sold insights on use behavior to outsiders. It closed its doors to other customers once Facebook acquired it.

Onavo was used to detect the popularity outside the United States of the messaging service WhatsApp, which Facebook purchased for $19 billion in 2014, several months after the Onavo acquisition, according to the people familiar with the company’s activities.

Onavo does not broadly advertise that it is owned by Facebook. Onavo is available for download in Android and iOS app stores. Onavo’s status as a Facebook unit is mentioned in the privacy policy after the app is downloaded and on the Onavo website in the “About” section.

Facebook’s new reputation as a threat to start-ups is a reversal from several years ago, when a wave of start-ups, from dating and food-delivery apps to political consultancies, were able to grow by targeting their customers’ friends — and friends of friends — on Facebook. Facebook has curtailed access by limiting what third parties can do within Facebook and is building some of the same features on its own.

Down to the tiniest details

A tour through Facebook’s app can feel like deja vu for avid app users.

For example, users who log onto Facebook are often first shown a feature called On This Day, a snapshot, contained in an orange picture frame, of themselves on the very same day last year, or four years ago. The feature is similar to a product once offered by Timehop, an app that had reached 6 million daily users just months before Facebook launched its own time-machine-like product.

Rick Webb, Timehop’s chief operating officer, said that Facebook had copied the company’s product down to the tiniest design details.

“Why did Facebook have to make it orange with little picture frames on angles?” he asked. “We now had to shift our coloring to make it more yellow!”

Webb said that Timehop’s growth had slowed but that by focusing on collecting pictures from Dropbox, Google Drive, the iPhone camera roll and other ­places where people store images, it maintained 20 million users, a sizable number for any app.

Facebook’s food-delivery tab, added last year, seems to be a play on start-ups such as Grubhub, Seamless, Caviar and Postmates.

This year, Facebook created a tab that enables people to raise money for personal or charitable causes — previously offered by sites such as Kickstarter and GoFundMe. It has offered a marketplace to sell goods like Craigslist and is reportedly building a group-video-chat app modeled on Houseparty.

In June, Scott Heiferman, chief executive of Meetup.com, the site that helps communities organize in-person meetup groups, said he was surprised to see Facebook chief executive Mark Zuckerberg announce his intentions to help people who use Facebook groups meet up in person.

Heiferman said he was threatened but not intimidated. “It’s not in their DNA,” he said. “They know how to keep people really engaged to a screen; everything about Facebook is geared toward that. The art and science and subtlety and nuance to get people to create real community is a different thing.”

He said it was a sign that his business was onto something.

“In this era of consolidation, whenever you figure something out, if you crack the code on that, then Facebook comes along and copies it,” he said. “There’s certainly fire under our feet to go faster and bolder, and I guess you could say that’s the good thing about competition.”