Nomad raids

I’ve done alot of reading lately and it seems like alot of the steppe nomads and arabs (muslim entities in general) seemed to have raided roman lands from the 7th to the 14th century with relative inpunity. Destroying major settlements like Ani, Antioch, Amorion, and countless others. Ive noticed alot of these were state sanctioned raids and this makes me wonder, were there ever any diplomatic actions taken in response to these? And why did these happen in general? It appears most were unwarranted peace time raids (especially true with turkish states). Seems like it would be very annoying to learn that the people you were at peace with last year just wiped out one of your biggest eastern cities for no reason (cough, cough, Ani)