Two types of graceful restarts are defined: planned and unplanned.
A planned restart would occur if the software module for OSPF (Open Shortest Path First) was upgraded, or if the router operator decided to restart the OSPF control function for some reason. The router has advance warning, and is able to inform its neighbors in advance that OSPF is restarting.
An unplanned restart would occur if there was some kind of system failure that caused a remote reboot or a crash of OSPF, or a failover occurs. As OSPF restarts, it informs its neighbors that it is in the midst of an unplanned restart.
You can decide to configure a router to enter graceful restart for only planned restarts, for only unplanned restarts, or for both. Also, you can separately decide to configure a router to be a helper for only planned, only unplanned, or for both kinds of restarts.