I wanted to know what the main difference between ASP and SaaS is. Is one better than the other or does that depend on the type of software you need?

For example, most QMS software nowadays is mainly built on SaaS. Is it safe to assume that no security or functional issues would arise with cloud-based tools?