How do we learn to count syllables? When I was young, I was told that to count syllables in a word, you could clap them. One clap for each syllable.

You would say it aloud like this: cu-shion.

I was not taught rules about how to pick out each syllable from a word. I just figured it out.

The funky thing with this is that syllables have no defined length, and some words are only one syllable while others are a few.

Learning how to count syllables is unlike math because in math, one can't do something until they have learned all the rules for how it should be done properly. I was never taught rules like this for counting syllables, I just figured it out.

My question: how do humans learn this skill without being taught? Is it like learning to walk?
Like most of language, we have an innate ability to learn by exposure, with the rules remaining subconscious until someone forces us to explain them.

Syllables are based on phonemes, so we need to know the rules of spelling if we don't already know the word by sound.  Each syllable consists of an onset and a rime.
The onset is a cluster of consonants (or it is null, at the beginning of some words).
The rime is a cluster of vowels {or diphthongs...}, plus an optional cluster of consonants {typically at the end of a word}.

Thus: cushion: [c] (u) + [sh] (io[n]) = 2 syllables