What is meant when a framework/library says "compile to Javascript"?
Solution 1:
Does language X literally compile to another interpreted language?
Yes, that's correct. You write code in elm, and then compile it into the equivalent javascript code. It needs to be in javascript, because that's what the browser understands (WebAssembly does exist, so javascript isn't technically the only option, but not everything is designed with WebAssembly in mind)
If compiled to JS - would that mean the code can only go as fast as JS does? (a lot of frameworks/languages tout how fast they are)
Yes. Though it could allow you to write high quality, efficient javascript code more easily, which is generally what they mean when they say it's fast.
Solution 2:
Does language X literally compile to another interpreted language?
Yes, indeed. 'Transpilation' is the actual term of transforming one high-level language into another.
If compiled to JS - would that mean the code can only go as fast as JS does? (a lot of frameworks/languages tout how fast they are)
In the course of transpilation, the transpilers usually apply optimizations to produce highly efficient JavaScript that has the potential to be way faster than the average handwritten JavaScript.