Stabilization mechanism of edge states in graphene