A garage door is programmed to move a certain distance before closing. If it shuts before travelling that distance, it registers that something may be wrong and reopens to prevent safety risks or damage.