Lighthouse loads a page in a controlled setup, usually emulating a mobile device on a throttled connection, and records what happens. It then scores categories such as Performance, Accessibility, Best Practices and SEO from zero to one hundred, and lists the specific issues behind each score.
You can run it in Chrome's developer tools, from the command line or through PageSpeed Insights, which runs it on Google's servers and adds real user data. Because it is a lab tool, results vary slightly between runs and depend on the machine and network, so repeat tests and compare like with like.
The common mistake is chasing a perfect score. The number is a summary, and some recommendations apply poorly to your case, while some real problems do not show up in a single test. Treat it as a way to find specific things to fix. It also cannot tell you what real visitors experience, which is the job of field data. Example: running Lighthouse before and after removing a heavy plugin shows the blocking time falling and the Performance score rising from the sixties into the eighties.
Related: PageSpeed Insights, Performance score, lab data, Total Blocking Time (TBT), estimated savings