A simple sentence (called a clause) is a set of phrases that fit together in a definite way. The glue that holds them together is the verb phrase, containing all the verbs ("action words": runs, are, working) in the clause. The other crucial type of phrase is the noun phrase, of which there may be several; a noun phrase is a group of words belonging together and centred around a noun (a thing, person, or concept: stone, girl, Sally, brilliance). You can imagine why these two types of phrase, namely verb phrase and noun phrase, form the spine of any clause: it takes things or agents to do stuff, and it takes action for there to be something worth saying at all.
Language can thus be fitted together on multiple levels: words form phrases, and phrases form clauses. Note that syntacticians will analyze single verbs or nouns as complete phrases in their own right; thus “beard” is as much a noun phrase as “the white beard”. Single-word phrases are not uncommon, as not everything needs qualifying: John likes Mary contains a verb and two nouns, each of which is also a phrase. The boy had seen a small mouse likewise contains three phrases: the verb phrase "had seen" and the noun phrases "the boy" and "a small mouse", but here each is composed of further constituent parts. Syntax is the analysis of sentences and clauses, describing how their components fit together. With the most important syntactic elements, this relationship is thought of as one of government: the subject (which does the action) governs the verb, and the verb governs the direct object (an optional element; this is the person or thing the action is applied to). Thus in the above examples, "John" governs "likes", and "likes" governs "Mary"; "the boy" governs "has seen", and "has seen" governs "a small mouse".
Such government also takes place on the lower level, that within the phrase. Simply grouping together the words "ape", "purple", and "that" doesn't make it a phrase; in Modern English, it is word order that establishes "that purple ape" as a phrase while disqualifying "ape purple that". However, word order is not the only way words may conceivably be linked up, even if it always plays some role across the languages of Europe. Certain languages, of which Latin is usually taken as the shining example, express the relationship between words by marking them with certain sound-patterns, usually at the end of the word. Thus the mouse in The boy had seen a small mouse would have the form "murem" rather than its dictionary form "mus", the em-ending signalling that this word is the direct object rather than the subject of the sentence. This phenomenon in which a word can take different forms is known as inflection, and the rules governing such variation of form in a particular language are sometimes called its morphology. Compared with Latin, Modern English has little inflection of nouns: mouse is written "mouse", whether it is a subject (governing the verb) or an object (governed by the verb). However, the form does change when the mouse owns any goods, so that we speak of the mouse's food-stock; similarly, when the mouse has company we speak of mice. The latter form is the result of a concept known as number (the grammatical recognition that there can be either one or more than one of something); the former, "mouse's", is a morphological expression of case.
In a language like Latin, German, or Old English, case is visible not just where possession is concerned (the genitive case), but wherever a noun or related part of speech rears its head. On the syntactic level, case shows whether a noun is eligible to be the subject or object of the clause's verb phrase. In the example with the mouse, murem proves incompatible with the function of subject: -em is the marker of the accusative case, and the rules of syntax have it that no accusative can ever be a subject. Conversely, the boy would in Latin be puer, whose form betrays its nominative case, which has the syntactic monopoly on subjects. No Latin speaker could thus ever be mistaken as to who had seen whom, whether the boy had seen the mouse or vice versa, as the Latin equivalent of "a mouse" inflected for this situation would be incompatible with the function of subject while the word for "the boy" would have the form required of subjects. Indeed, the Roman author could shuffle the word order in any conceivable way and the relationship between the words would still be crystal-clear! If you try the same strategy in Modern English, this would hardly be the case: "A mouse had seen the boy" is a perfect inversion of the state of affairs in the original sentence. In this respect, Modern German and Old English take a position midway between Latin and Modern English: the boy does the seeing regardless of which comes first in the sentence, but word order in these languages is not quite as free as in Latin. You can think of these languages as moving away from inflection: in prehistoric times they were more heavily inflected, like Latin, but Old English was already on its way towards the lightly-inflected Modern English, which instead of case relies heavily on word order and the use of prepositions, which describe the relationship between elements in space, time, or abstraction: in, towards, during, about.
Case functions not just on the syntactic level, but also within the phrase. Consider the difference between the Modern English prepositions in and into: one implies stasis, the other motion. Latin, Old English, and German also have the preposition in, but they have no separate word for into. Accordingly, these languages need an alternative way to make clear whether, say, John is speaking in the temple or into the temple. This is where case comes in. It is a grammatical rule of all these languages that prepositions containing this ambiguity take the accusative when motion is intended, but the dative (in Latin the ablative) when there is none. Thus Latin in templum versus in templo, Old English in þæt hof versus in þam hofe, and German in den Tempel versus in dem (or im for short) Tempel. Note how Latin applies the case endings to the noun, but German inflects the little word preceding it (the article, Modern English the), while Old English inflects both. Here, Old English and German show different stages of moving away from a primary reliance on case towards the use of little words like the.
Again in all three languages, prepositions without ambiguity of motion, as well as all verbs that govern an object (transitive verbs), are bound to one or more specific cases with which they can combine. In Old English, be ("by, concerning") always takes the dative; ymb ("concerning, around") is always followed by an accusative; and andlang ("along") always goes with the genitive. Thus be streame "by the river"; ymb stream "about the river"; andlang streames "along the river". You may think of the elements of a sentence as screws and screwdrivers, where each grammatical case is a particular shape of drive: driver and groove have to correspond for the two to fit together. Such demands are more stringent in Latin and German than they are in Old English, however, so that Old English has many verbs and prepositions that can take one of two, sometimes one of three cases without distinction (it has a lot of screws of the combined Phillips/flat slot type).