The answer by Dr Jetušek is great but I would strengthen it a little bit: the declension indeed helps to fight the ambiguities and whenever they survive, which is a very small percentage of cases, it is almost deliberate.
Both Czech and Polish use declension with seven cases which were inherited from the Old Slavic system. The declension often plays the same role that require additional prepositions in other languages.
The seven cases, as ordered by the Czech rules, are
- nominative: Who? What?
- genitive: Of whom? Of what?
- dative: To whom? To what?
- accusative: [verb, object follows] whom? What?
- vocative: We call, we shout.
- locative: About whom? About what?
- instrumental: With whom? With what?
I added some translations of the usual "questions" by which the Czech schoolkids actually learn them – almost no children are taught the Latin names.
In some cases, the translation was hard, e.g. in the case of accusative, because English doesn't have seven cases.
The vocative is exceptionally alive and well in Czech and perhaps Polish: to call a person, we have to use a different case. A big portion of the languages have had it but in most of them, it went extinct.
The genitive (2nd) and the accusative (4th) often have the same form of the word; the dative (3rd) and locative (6th) tend to be similar, too.
The cases help to distinguish lots of different possible meanings of the sentence. Some sentences with the word "wave at" ("mávat") and "fork":
- Vidlička mává (A fork is waving, the fork is the subject.)
- Mává bez vidličky (He is waving without the fork.)
- Mává vidličce (He is waving to the fork – as if it were a human.)
- Zvlnil vidličku (He made the fork wavy, he rippled the tool.)
- (also: Mává skrz vidličku (He is waving through the fork.))
- Mává: "Vidličko!" (He is waving and shouting: "Miss Fork!")
- Mává o vidličce. (He is waving, as if waving were a language, and his story is about a fork.)
- Mává [s] vidličkou. (He is waving with the fork.)
And others. You may see that the 3rd case automatically translates with an extra "to" while the 7th case almost always translates with "with" to English. So in these two cases, the role of the case for preserving the right meaning is essential, even in the absence of any prepositions.
As Dr Jetušek wrote, the 7th case does not need an explicit "with" (in Czech: "s" or "se" if the following object starts with "s" or a similar consonant). When "with" is explicitly written down, it sounds like the object possessed the spoon or fork; when "with" is omitted and one only uses the pure 7th case, it almost always means that the word in the 7th case was the tool to achieve the process given by the verb.
The 2nd case, genitive, often represents ownership when no preposition is added. For example, the following sentences represent different case (1-7) of the word "[Old] Hungary":
- Král Uher daroval koně. (The king of Hungary donated a horse [to someone].)
- Král Uhrám daroval koně. (The king, probably a different one, donated a horse to Hungary.)
- Král Uhry daroval koňům. (The king donated Hungary to the horses. The 3rd and 4th cases are reverted relatively to the previous example but the order of the words may be kept. The declension is enough to distinguish what is the gift and what is the recipient. Languages with declension unavoidably have a much greater freedom in the ordering of the words.)
- Král Uhrami daroval koně. (The king donated the horses, through or using Hungary in some way. The Czech sentence isn't quite comprehensible but it is arguably fine from the grammar viewpoint.)
The seven cases (of declension) are useful to change or preserve the meaning but so is the letter case. The word "uhry" in lowercase means "pimples" which is something else than "Hungary". ;-)