Both maintain their own backlink index and calculate their scores with different formulas. That means their authority metrics will rarely match, unless the website is very established. That said it makes little sense to compare the metrics across both providers.
Stick to the provider you trust more and perform domain/page authority comparisons in the scope of a single SEO metrics provider.
Personally, I think Ahrefs is more accurate. Their crawling bot is supposedly the second most active bot after Google.