How did geography help prevent the spread of the plague?
Population density and climate affected how the plague could spread from person to person.
It is now thought there were two different plagues that formed the Black Death - Bubonic and Pneumonic.
For the Bubonic plague to spread, there had to be a way for fleas to bite people - usually through the transferral from a rat. This limited its spread, as an area had to be hospitable for the rats to spread the plague. This helped protect places like Russia, which was very cold and therefore hard for the bacterium, fleas and rats to survive in.
For the Pneumonic plague, you needed people - specifically a large, dense population as the bacterium spread through human contact and airways (so sneezing and coughing would be a big spreader). Therefore, towns and cities were affected the worst, and sparsely populated/rural areas were left alone.
An example can be found in the UK. The plague landed in Dorset in 1938 but didn't spread to Scotland at first, due to the high land, cold climate and sparse distribution of people. It only spread after Scotland invaded England (believing the plague was a punishment from God to England and so Scotland wouldn't be affected... whoops!)
I hope this helps:) Let me know if I can do anything else.