I think that yes, there are some people who are truly depressed because of chemicals in their brain, but for most people there is some kind of trigger, or a general dissatisfaction for where they are, that leads them to be depressed. And chemicals in our brains can make us or more less susceptible.
For example, I have Asperger's and OCD, and with those disorders, there's a lot more that your brain perceives as "going wrong", and you have very black and white thinking. So when something goes wrong it's easy for me to completely off the rails and go straight to wanting to die. But there had to be an initial trigger. Even something like feeling overwhelmed by school that you just don't want to do anything, or doing something you always wanted to do and feeling empty after it was over.
So I believe that depression is an illness, 100%, though certain mindsets/chemicals can make us more susceptible. Either way, you should never be ashamed either way if you have depression, because as humans most of us are conditioned to have mindsets that make us depressed at some point. We are conditioned to compare ourselves against other people, to seek familiarity instead of challenging ourselves to improve, to give up easily, to not give ourselves love and validation but seek it from others instead, etc.