One of the biggest creators of the accidental Sue is the Informed Attribute. It is very easy for an author to simply fail to realize that the character that she envisions is not the character that she wrote. Fridge Logic also gives birth to Mary Sues.
These are the hardest things to avoid. Avoiding them requires looking at one's work dispassionately and considering the implications of what is written, without regard to the characters. Beta readers are a good help for this.
YOU ARE READING
How to not write a Mary Sue
RandomA Mary Sue is an idealized and seemingly perfect fictional character. These characters are often irritating and cringe worthy. This book will tell everything about identifying a Mary Sue and how to avoid them.