Some people engage in self harm behaviour. They do not intend to die. They die by accident.
Some people engage in self harm behaviour. They have mild intent to die, and they do die. Sometimes these attempts are repeated often, for years, before completion.
Sometimes people feel themselves to be in an impossible place. And thoughts of suicide are comforting. At least there's a way out. And when someone has decided to try suicide they often appear calm and happy. Things are decided and they know what to do.
There are many things that contribute to people committing suicide. These things include mental ill health, relationship breakdown, debt, legal pressure, societal pressure.