It’s a happy accident. They were working on a diabetes treatment, which they did develop. The side effects included weight loss, so it started to get prescribed off-label for that. Then they did the required testing to get it approval for weight-loss.
It works because it is a fake hormone that mimics GLP-1, a hormone that is involved with appetite regulation. When it binds to the GLP-1 receptors it causes more insulin to be released in response to sugars which lowers blood sugars. The weight loss doesn’t come from that, though, it comes from the appetite suppression.
A lot of people seem to think you can eat as much as you want while you’re taking it. That’s technically true, but really because you won’t want to eat much.
No, it means the printer driver is running a web server to host the status page. Localhost is literally your computer.