In medieval times, a hamlet was a community without a church.
A village had a church, but no full-time cleric.
A town had a church and resident cleric.
A city had a bishop and a cathedral.
While there is certainly a correlation between population and community designation, the fact remains that community designation had to do solely with a church, not a populace.