The history of the St. Bernard dog breed is one that is mysterious and almost mythical. But there are some things that are known to be factual or at least probable. For one thing, the St. Bernard's ancestors were likely working dogs, hence the breed's categorization in today's breed recognization associations like the American Kennel Club and the FCI. The fact that the dogs were working dogs explains why they were eventually bred to be rescue dogs and also explains their size and temperament.
When Roman armies invaded the area that is today known as Switzerland, they brought with them many dogs. These dogs were not what we know as today's St. Bernard. Rather, they were ancient ancestors of the breed we know today. The dogs belonging to the Roman armies were bred with native dogs in Switzerland, beginning the breed we now know as the St. Bernard.
The dogs that were native to the Swiss valleys and farms during this period of time were named for their jobs. Since most dogs at this time (around the first few centuries CE) were working dogs, it is not unreasonable to assume that dogs like the Talhund, or valley dog, and the Bauernhund, or farm dog, are the ancestors of the St. Bernard. These dogs were responsible for typical jobs on the farms and in the valleys; they herded livestock, hunted game with their masters, and also were excellent watchdogs both for the farmers' families and their livestock.
In the twelfth century CE, an archdeacon named Bernard de Menthon established a monastery and hospice in the Swiss Alps. This hospice and monastery was located in a pass now known as the St. Bernard Pass, which was almost impassable during most of the year. Bernard and his monks began breeding the local farm and valley dogs as rescue dogs, and from there we find the breed we now know as the St. Bernard dog.
Today's St. Bernard is classified as a working dog, but he is not generally used as one any longer. He is more commonly a home companion for families. The dogs are still bred and kept in the St. Bernard Monastery in the St. Bernard Pass as a salute to tradition, but they are no longer used as rescue dogs.
St. Bernards can still do some working feats, and they are often entered into dog sporting competitions. The dogs are incredibly strong, so they often will do things like pulling and strength competitions. But currently, this is the only regular job that this former working breed has. He does retain his abilities to sniff out and find people, and could still be used as a rescue dog if he was trained properly.