sentence1: For 300 years, until forcibly united in the late 18th century, they were separate kingdoms with related, but not always friendly, Malla rulers.
sentence2: The kingdoms were sometimes at war, but often allied against other threats.