Help came just in time to prevent a disaster
As an expression, "just in the nick of time" differs from simply saying "just in time" in that the latter could be used in almost any circumstance - such as 'he arrived just in time before they cut the cake', whereas the former implies that the person arrived in time to prevent a disaster of some sort, such as "he arrived in the nick of time to save her from drowning".
This expression appears to have been in use for about three centuries but the expression "in the nick", meaning the same thing, dates back earlier. The nick in question being a notch or groove, such as one might cut into a stick of wood - which, in the context of an event, would be that point in time where events would forever be altered without intervention.
Amazon cuts off 5200 affiliates in Minnesota(Jun 19 2013) With Minnesota's online sales tax law due to take effect July 1, Amazon has played a familiar card by cutting ties with 5,200 members of its Associates...