What's the thinking on the causes of depression?

My regular GP has been great over the years, but some time ago I saw a different GP and she basically said that being emotionally upset over something doesn't set off a depressive episode. I'd gone back to the surgery (after being medication free for a couple of years and life generally being okay) as my husband's mother had died, so I was upset for him and his family, and it brought back of the memories of when my mum died, so I was in quite a state. Anyway she said it was a chemical imbalance in my brain, nothing to do with the emotional upset and that I'd probably be on medication for the rest of my life. After all, people take lifelong meds for heart problems, diabetes, etc so why should depression be any different?

Now this didn't sit well with me, so googled it and am even more confused. It seems that chemical imbalance is accepted by some medical professionals, and emotional causes etc are accepted by others.

What do others think?