The masked servant fools of the Commedia dell' Arte. In usage, sometimes it is the name of a specific servant character. Other times it is a collective noun referring to all the masked fools.
From the Italian for John, Johan, Jens.
Giovanni becomes Gianni becomes Zanni.
Which in English becomes zany, meaning crazy.