For many years it was thought that depresssion was a chemical imballance in the brain that led to low amounts of serotonin. However that theory was called into question many years ago.
For a start we cannot measure serotonin in the brain so it calls into question how you could be prescribed the right amount of medication if you dont know how much of a shortage there is. Also since the brain makes serotonin and other neurotransmitters in an instant your brain chemicals are in constant flux anyway.
Depression seems much more likely to be a reaction to how you see your environment. It can be learnt from others and often runs in families because if people around you act in a certain way it often rubs off.