and I see that Quarry reports 168668 while the REST API reports 169754
edits for the same period (less than 1% error).
The first thing to consider is that when a Wikipedia page is deleted, all the corresponding rows from the revision table are moved to a separate archive table (probably for reasons that made much more sense years ago). However, in the Data Lake and therefore the REST API, there's no such separation.This query is one way to get a combined count: https://quarry.wmflabs.org/query/25794
However, combining the two tables yields 171 346 edits, which makes the Data Lake count about 1% lower than the application database count.