The reason why Dunder Mifflin was being filmed for a documentary in The Office is extremely dark. Like its UK progenitor, NBC's The Office was shot to simulate a documentary through a single-camera setup and talking head character interviews. For most of the series, the explanation surrounding the camera crew remained a mystery.
The mostly unseen camera crew were a background presence in the daily lives of the Dunder Mifflin employees. They primarily stayed out of the way until the final season when boom operator, Brian (Chris Diamantopoulos), jumped on-screen to prevent a warehouse worker from attacking Pam (Jenna Fischer). That was the only time a member of the camera crew became a physical character on the show, and he was subsequently fired from the documentary for intervening.
In The Office season 9, the Scranton employees learned that their documentary was finally airing to the public on PBS. As the series' ending drew near, Pam contemplated why Dunder Mifflin's Scranton branch was picked by a documentary project in the first place. She stated that she thought it was weird at first but as time went on she thought a small paper company was a perfect choice as there could be "beauty in ordinary things." But that might not have been the goal of the documentary according to The Office's writers.
During The Office Convention in 2007, some of the show's writers took part in a Writer's Block Q&A session. The panel, which can be found on the season 4 DVD, shed light on why Dunder Mifflin was filmed for a documentary. The writers claimed that after one of the Scranton employees committed suicide, the film crew picked Dunder Mifflin to document how the office handled the situation. Those in charge of the documentary then changed their focus when they realized the day-to-day lives of Michael Scott and his employees was much more interesting.
The employee that took his own life was Tom Peets. He was mentioned in The Office season 2, episode 8, "Performance Review." Michael (Steve Carell) looked through the office's suggestion box for the first time in years. One of the suggestions stated: "We need better outreach for employees fighting depression." That note came from Tom, an accountant that went on to shoot himself according to Phyllis (Phyllis Smith). Michael didn't even remember him, adding to the notion that Tom's well-being was never acknowledged by his co-workers.
Tom's death also provided an explanation into Ryan's (B.J. Novak) hiring as a temp. The void left by Tom allowed the Scranton branch to fill the position. Ryan wasn't hired as an accountant but he did fill a need throughout other departments. It's unclear if Tom's death was ever meant to be discussed further in the show as the backstory for the documentary. It's more likely that the writers of The Office came up with the idea on their own to fill in the gaps of the show's backstory. Tom's fate is oddly morbid for a comedy series and they made the right choice by glossing over the detail.