Hammerspoon is a way to automate things in macOS with Lua, but the website doesn't mention why it would work better than AppleScript or JavaScript
Not better, just different. There are multiple tools to automate macOS and applications. There is overlap, but no one tool that does everything and all tools bring some compelling features and specific strengths.
It is hard to automate on a Mac without at some point needing AppleScript (and shell scripting). This is because AppleScript is the direct way of interacting with apps which present/publish an AppleScript interface - it is the glue that allows connection between an automation tool and an app. I note that Hammerspoon has an API for calling AppleScript.
I don't have experience with Hammerspoon though I considered it before deciding that KeyboardMaestro was more suited to my style and tastes.
JavaScript (as exposed by the Script Editor) gives access to the same functionality as AppleScript, it doesn't bring anything different except for the language.