Magic is one of the few advantages the Equestrians have. They heavily rely off magic for pretty much everything. If the Triarians were able to do that they could destroy all or the Eauestrians infastructure. There is a set of rules that govern magic, and only a few are able to use it to a great degree. The average unicorn only has a few spells and no combat magic what so ever. There is also a pretty easy way to defend against magical attack. It's called energy shielding.