The apinger process periodically pings the WAN gateway (by default) in order to monitor the quality of the connection. If it sees excessively high pings times or packet loss it flags an alarm. If either metric become very high it will mark the interface as down. If you are using fail over this is used to determine which WANs are good.
Usually I would expect to see a warning in the logs about either 'delay' or 'packet loss' before the WAN is marked down however if the condition is extreme enough it may go straight to 'down'.
If the quality of your WAN connection is such that apinger is being triggered too early you can tune the thresholds in System: Gateways: Edit gateway: Advanced. You can also disable gateway monitoring completely if you don't need it fail over or load balancing (if you only have one WAN).
Steve