Facebook made a heralded change to its algorithm in 2018 designed to improve its platform—and arrest signs of declining user engagement. Mr. Zuckerberg declared his aim was to strengthen bonds between users and improve their well-being by fostering interactions between friends and family. Within the company, the documents show, staffers warned the change was having the opposite effect. It was making Facebook, and those who used it, angrier. Mr. Zuckerberg resisted some fixes proposed by his team, the documents show, because he worried they would lead people to interact with Facebook less.