They're both global professional advisories with a ton of similar services and competing for similar clients. They ought to be thought of as basically body shops for management consulting.
Accenture was spun out of Andersen Consulting after the Enron saga. Andersen had both a consulting business and an audit arm - they were one of the “big five” audit firms before the collapse of Enron. Today, Accenture only do consulting; they do zero auditing.
EY are not related to Accenture or Andersen. EY is an audit firm (one of the “big four”) with a massive consulting arm. Unlike Accenture which is a global firm, EY operates more like a local franchise. They do this to minimise risk of contagion from a bad apple like in Germany to other audit businesses in different countries. As such, EY is far from a global firm, but more like a collection of separate audit and consulting firms in different countries who all have a license to use the EY brand. This is an important difference.