This is a question often asked as not all hillforts are in fact on hills and they may not all have been 'forts'. They began to develop in the Bronze Age after around 2,000BC and many of them have Bronze Age burial cairns within them.
They continued to develop into the Iron Age which began in Britain around 700BC and reached their full development by the mid- Iron Age.
the most famous of these hill forts is probably Maiden Castle in Dorset which is a very impressive monument and was eventually sacked by the Romans who massacred many if not all of the inhabitants.
The hillforts of the Maiden Castle type may have been pre- Roman tribal capitals and the proto-types of small towns.
They are often complex monuments with varying numbers of ramparts ranging from univalite to multivalite ramparts. they had houses within the interior of the ramparts and may have served as refuges in times of strife or permanent sites for the community.
Some were occupied well into the Roman period and beyond.