You need to say sorry when you have done something wrong, you have hurt someone or if you have hurt their feelings.
It is difficult to say sorry when you have done something accidental or really bad because if it is really bad it might be hard to admit it. Whereas if you have done something accidental you don’t feel like saying sorry because you don’t think you have done anything wrong.
It is important to say sorry because you might upset people or you could never be forgiven. You might also hurt their feelings even more.