Agile processes were designed to help with the management of development projects and to improve delivery time by reducing their complexity; this is done by creating small teams that work closely together and operate using a “sprint” structure to deploy code updates incrementally.
Like agile, DevSecOps is also built around a continuous development and testing process, using a cycling build-test-deploy workflow to keep delivery frequency high while ensuring overall high quality of code.
The two disciplines are not mutually exclusive. Agile shops can — and often do — also adopt DevSecOps principles or create some kind of hybrid structure that merges the two approaches.
The main difference is that agile development methodologies (e.g. Scrum and Extreme Programming) have more to do with how development teams are structured and how developers create code. DevOps is more focused on how code is compiled and released. Agile methodologies result in iterative code changes at a faster cadence, necessitating automation and DevOps practices. Technically, DevOps practices and tooling can exist without agile development methodologies, but the reverse situation is less true.
Another difference between agile and DevSecOps, of course, is that agile was not explicitly envisioned with security top of mind, while DevSecOps stresses the importance of integrating security in the development process from the start. In many agile shops that have not also adopted DevSecOps practices and strategies, security remains an afterthought. However, both disciplines often work together and, in many respects, need to.