From the Wiki page about the series:
The show portrays the home's workers and residents as outsiders who struggle in life due to being disadvantaged, excluded from, and unwanted by, mainstream society.
Gervais's character, Derek, goes beyond his job description to help the residents for whom he cares. The character's quirky, goofy, and often hare-brained personality is tempered by a tender, honest and brave spirit.
The majority of the show takes place in the modest nursing home and surrounds the lives of the characters who hang about the facility, be they caretakers, residents, repairmen or a random, homeless man. During the first series, the programme changed settings to show the characters interacting with outsiders at shops, pubs and even a day trip to the seaside.
Gervais has said that the programme was inspired by his relatives who work in care homes: "Half my family are care workers. My sister works with kids with learning difficulties. My sister-in-law works in a care home for people with Alzheimer's. And four or five of my nieces work in old people's homes. I always write about what I know."