Idiom, also called idiomaticness or idiomaticity, is the syntactical, grammatical, or structural form peculiar to a language. Idiom is the realized structure of a language, as opposed to possible but unrealized structures that could have developed to serve the same semantic functions but did not.
The grammar of a language (its morphology, phonology, and syntax) is inherently arbitrary and peculiar to a specific language (or group of related languages). For example, although in English it is idiomatic (accepted as structurally correct) to say "cats are associated with agility", other forms could have developed, such as "cats associate toward agility" or "cats are associated of agility". Unidiomatic constructions sound wrong to fluent speakers, although they are often entirely comprehensible. For example, the title of the classic book English as She Is Spoke is easy to understand (its idiomatic counterpart is English as It Is Spoken), but it deviates from English idiom in the gender of the pronoun and the inflection of the verb. Lexical gaps are another key example of idiom.
Monolingual native speakers in an insulated monolingual-native environment are mostly not conscious of idiomaticness (the quality or state of a construction matching the idiom of the given language), because in general their minds never reach for, or hear, other possible structures. The main exception is when they hear the natural experimentation of children acquiring the language, when they may encounter, for example, overregularization (for example, I seed two deers for I saw two deer). By this correlation, solecism to native-speaking monolingual minds often sounds childish. However, when adults study a foreign language, they become consciously aware of idiomaticness and the lack of it. For example, in English it is idiomatic to use an indefinite article when describing a person's occupation (I am a plumber; she is an engineer), but in Spanish and many other languages it is not (soy plomero; ella es ingeniera), and a native speaker of English learning Spanish must encounter and accept that fact to become fluent.
The count sense of the word idiom, referring to a saying with a figurative meaning, is related to the present sense of the word by the arbitrariness and peculiarity aspects; the idiom "she is pulling my leg" (meaning "she is humorously misleading me") is idiomatic because it belongs, by convention, to the language, whether or not anyone can identify the original logic by which it was coined (arbitrariness), and regardless of whether it translates literally to any other language (peculiarity).