ISIS isn't a formal army, they can easily blend in with normal people, borders aren't as secure as you think even the borders of the US aren't secure let alone those of third world countries.
ISIS are supplied and funded by several regional and intercontinental powers, as long as this continues...