Is suicidal tendencies an autism feature or just an effect of being ostracized by society?

This may be a really stupid question, but ive been seeing post about suicide in this sub a lot recently.