That immediately cut off Facebook’s 35,000 workers from its internal iPhone apps. And the problem snowballed when mobile apps like Workplace and Messenger — two internal communication tools — also stopped working, frustrating employees and resulting in hours of lost productivity.

Late Thursday, Apple relented and restored Facebook’s access. Yet the episode was a stark reminder of where the power really lies in the technology world. While Facebook is the world’s biggest social network, Apple controls the distribution of apps — including Facebook’s — on its phones. That power is a longstanding concern for Mark Zuckerberg, Facebook’s founder and chief executive, making his company beholden to the rules of others.

The spat underscored the tensions between two of Silicon Valley’s largest tech companies, which have competed for years over talent and new technologies. Recently, each has taken potshots at the other over data privacy, with Apple’s chief executive, Timothy D. Cook, trading slights with Mr. Zuckerberg in interviews. Facebook also worked last year with a public-relations firm, Definers Public Affairs, to urge reporters to scrutinize Apple and other tech companies. And Apple has made changes to some of its tech features that limit the ability of Facebook and others to track users.

Apple did not immediately have a comment on Thursday after reinstating Facebook’s access to its internal apps. In a statement, Facebook said it was “getting our internal apps up and running” and added, “To be clear, this didn’t have an impact on our consumer-facing services.”

In an interview on Wednesday, Sheryl Sandberg, Facebook’s chief operating officer, said of the dispute with Apple, “Obviously we want to be in full compliance with all of our partners.” She added that the Facebook research app at issue hadn’t been a secret and had been operated only with its users’ consent.