I don't think that there is any semantic difference; at least I can think of no two sentences that have the same syntax otherwise and only differ in whether there is a zu present or not, and differ in meaning.
That means that the difference is syntactic: There's constructions that just require a zu (just like in English there are constructions that just require a to).
Ich kann nicht schlafen
I cannot sleep.
These are simple modals that don't require zu/to. There's a few of them in German (können, wollen, dürfen, sollen, müssen), and if I remember correctly, even fewer of them in English.
Ich mag es, im Wald spazieren zu gehen.
These are infinitive clauses. They are a strategy for nomimalising the verb: Usually, mögen combines with a noun, not with a verb:1
Ich mag Pina Colada.
So to combine with a verb, or the whole predicate, the predicate needs to become a noun.2 In German, this is frequently done by replacing it with an empty es, and putting an infinitive clause to the right.3 The English equivalent would often be a gerund:
I like taking a walk in the woods.
(Again, this is a nominalisation strategy, since like, too, usually combines with a noun:)
I like Pina Colada.
3. Verbs that go with zu
Then again, there are many verbs that simply only accept a complement with zu:
Der Baum scheint zu brennen.
The tree seems to be burning.
These verbs can't be used with bare infinitives. (Der Baum scheint brennen, The tree seems be burning both are bad.) We can't say that that's because the verb wants to go with a noun, because scheinen doesn't go with a nominal object at all. It's just a property of the verb.
4. sein + Infinitive
Die Explosions war auf zwei Kilometer zu hören.
In German, you can use sein + infinitive to signal that something can or has to be done. You can do something similar in English, only you have to use the passive form (which is somewhat more in line with what the construction actually means:
Nichts war zu hören.
Nothing was to be heard.
Or, for expressing some sort of obligation:
Das Buch ist bis Freitag zu lesen.
The book is to be read by Friday.
1: Except for the obsolescent (or dialectal) usage of mögen meaning "to be able to": Mag sein. (lit.: "May be") (And for some reason, in my dialect, I can easily do "Ich mag nicht essen", while "Ich mag essen" sounds a bit odd.)
2: The story isn't quite as simple as "If it wants a noun, you have to give it a zu-verb, if you give it a verb at all", because even German modals are often quite happy with a noun as complement: Ich will Pina Colada, Ich kann Englisch
3: A strategy that doesn't require zu is to put the predicate first: Im Wald spazieren gehen mag ich. But this is much rarer, especially in writing, and for some reason sounds particularly bad with this specific example. It's a lot better in something like Schnitzel essen ist meine Lieblingsbeschäftigung.