What does it mean for a language to have "order"? In calculus, a polynomial has order $n$ if it contains terms that raise the unknown to a power $n$.

I'm trying to figure out how this definition of "order" relates to the use of the same word when talking about formal languages.

We say a logic or language is "first order", "second order", or "higher order".  I know it is related to what kinds of states of expressible within that language,b ut what does this mean, fundamentally, and why is it called the "order" of the language?
My angle on a related distinction: http://chrisamaphone.livejournal.com/751991.html

The "order" of nth-order (including higher-order) logic refers to the level of things that can be quantified over. In first-order logic, the things quantified over are terms of some unrelated domain: "All men are mortal." In second order logic, you can quantify over first-order predicates: "All properties of men also hold of dragons." Higher-order logic is the generalization of this to all higher predicates, which I think is better understood in terms of system F-omega (equivalent to HOL), wherein you can form type operators (constructors of kind type -> type) which can be quantified over as well as types.

The relation to "order" in polynomials is better understood as an analogy pertaining to recursion (nth order polynomials include a term multiplied by itself n times) than anything more rigorous.