Ansar's article on this is great. I'll just highlight the comment on this by ibn Taymiyyah:
“It refers to fighting those who are waging war, whom Allah has permitted us to fight. It does not refer to those who have a covenant with us with whom Allah commands us to fulfill our covenant.” (Majmu` al-Fatawa 19/20)