Brent has a great post on the importance of Apple events and Mac automation. I’ll add that AppleScript being more-or-less tied to the GUI means it has GUI-like consistency compared to the various incantations one is expected to memorize for CLI scripting.
http://inessential.com/2019/04/25/the_under_appreciated_awesomeness_of_app