Banjos are essentially drums with strings. Imagine a drum with an animal skin head stretched over it, a wooden neck attached to one side and some gut strings from one end of the neck to the other side of the drum. Add a device for tensioning the strings at the end of the neck and a bridge making contact with the head, over which the strings pass and you have a rough banjo. Make the strings vibrate, and the sound is carried via the bridge to the sound chamber (drum) and amplified.
The banjo probably started life in Africa, but could easily have evolved in several other places as well. The number of strings would have been variable, there wouldn't have been any frets, and the way you made the strings vibrate was up to you. They could be hit, plucked or struck(even bowed).
It is generally thought that wherever Africans travelled, they took the banjo or constructed banjo type instruments with locally available materials. This is assumed to account for the rise to popularity of the banjo in the United States in the 18th and 19th centuries.
As with all evolution, there tends to be a profusion of variations wherever variation is possible - in the case of the banjo, the length of the neck and the number of strings. Anywhere from 3 to 10 strings has been known, but now they have settled into either 4 or 5 string varieties (mostly).