The founding of the Hidden Villages only goes back about 100 years. The same goes for the sealing of the Tailed Beasts. So is there any back history on them? Did they go on rampage a lot? Did they just ignore everything and it were the shinobi that discovered how to seal the beasts into themselves, to use as a tool of war? Or was it something else?
After the death of Hagaromo Ōtsutsuki, the Tailed Beasts went their own way. Kurama's belief, that the tails was a measure of strength, apparently paved way for the beasts to part ways.
The humans regarded the Tailed Beasts as monsters and sources of immense power. They did not care about the live essence the Beasts had.
To gain advantage during times of war, the humans tried to exploit the Beasts' powers. They only thought of the Bijuu as weapons of mass destruction. This in turn, angered the Bijuu and brought forth the hatred towards mankind.
From Tailed Beasts article:
Over the centuries, humanity failed to recognise the tailed beasts as sapient individuals, instead seeing them only as monsters, demons, or mindless beasts worthy of fear and disdain. Because of their immense power, the tailed beasts were sought out by humans to be used as weapons in times of war. The beasts resented this treatment and came to hate humans, at times willingly becoming the monsters they were viewed as.
So, they were trying to lead peaceful lives away from mankind before the formation of Hidden Villages. But due to the constant provoking of the humans, they decided to fend them off by becoming what the humans thought they were.