Twelve keys
C, C♯, D, D♯, E, F, F♯, G, G♯, A, A♯ and B, then C again.
One octave, from C to C. The number on each key tells you how many frets up the string that note is. There are seven white keys and five black, and then the pattern starts again.
Twelve frets
One string tuned to C, frets 0 to 12.
The C string from open to fret 12 holds the same twelve notes in the same order, as twelve identical frets. Nothing about a fret tells you which note it plays.
Take any string and press the next fret up, and the pitch rises by a semitone, the smallest step in Western music. After twelve of those steps you are back at the note you started on, one octave higher. A ukulele neck is that run of twelve notes, repeated on each of its four strings.
A keyboard makes this easy to see, with seven white keys and five black before the pattern begins again. The neck shows the same twelve notes as twelve identical frets, and nothing about them tells you which is which. Most of what feels arbitrary about the instrument at first comes from that one difference.
A concert ukulele has about fifteen frets, so you get the full twelve and the start of the repeat. The double marker at fret 12 shows where the pattern starts over.