As correctly stated, this is a literal phrase dating from 17th century England. Back in the day, peasants used what little land they owned for crops and such, so could not afford to keep cats and dogs on their land. As a result, people used to keep their animals on the thatched roofs of their cottages. When it rained heavily, the thatching became very perilous and slippery, causing the cats and dogs to fall off!
Oh golly, it sure is raining cats and dogs old chap!