The concept is known as JavaScript Semicolon Insertion or “Automatic Semicolon Insertion“. This blog post: JavaScript Semicolon Insertion: Everything you need to know outlines the concept well in an understandable manner using examples under the headings:
- Where Semicolons are Allowed
- Where Semicolons May be Omitted
- The rules
It even digs into the official ECMAScript specification about the topic.