Firstly, scripting languages are USUALLY not compiled. That is a large part of what generally defines them as scripting languages. They are often, instead, "interpreted." What this essentially means is that there is another language (one that is compiled, more often than not) that is reading in the text, in real time, and performing operations, line-by-line.
The difference between this and other languages is that scripting languages tend to be simpler (commonly referred to as "higher level"). However, they also tend to be a bit slower, as compilers tend to optimize a lot of the issues that come with the "human element" of coding, and the resulting binary tends to be smaller and faster to read, for the machine. Additionally, there is less overhead from another program needing to be run to read the code being run, with compiled programs.
Now, you might be thinking, "Well I get that it's a bit easier, but why on earth would someone give up all that performance for a little bit extra ease of use?"
You would not be alone in this assumption, however the level of ease you tend to get with scripting languages, depending on what you're doing with them, can be well worth the sacrifice in performance.
Basically: For instances where speed of development is more important than speed of the program being run- use a scripting language. There are PLENTY of situations like this in game development. Especially when dealing with trivial things like high-level event handling.
Edit: The reason lua tends to be rather popular in game development is because it is arguably one of the fastest (if not the fastest) publicly available scripting languages on earth. However, with this extra speed, it has sacrificed some of its convenience. That being said, it's still arguably more convenient than working with straight up C or C++.
Important Edit: Upon further research, I've found that there's a lot more controversy over the definition of a scripting language (see Ousterhout's dichotomy). The primary criticism of defining a language as a "scripting language" is that it is neither significant to the syntax nor the semantics of the language that it is interpreted or compiled.
While languages that are usually considered "scripting languages" are usually traditionally interpreted, rather than compiled, the long and short of their definition as "scripting languages" is really up to a combination of how people view them, and how their creators defined them.
Generally speaking, a language could be easily considered a scripting language (assuming you agree with Ousterhout's dichotomy) if it fulfills the following criteria (according to the article linked, above):
- They are typed dynamically
- They have little or no provision for complex data structures
- Programs in them (scripts) are interpreted
Additionally, it is often accepted that a language is a scripting language if it is designed to interact and function alongside another programming language (usually one that is not considered a scripting language).