You only have to put your finger somewhere in between two frets to get a particular note, so you can play more than the tiny handful of chords that can be played on something like a violin.
There are non-fretted guitars but they are rare, and I think early banjos were not fretted.