The 40 amp breaker is for branch circuit protection from short circuit and ground fault (fast current rise / short duration event). The motor overload device is for slow current rise / longer duration protection.