Actually the answer is quite simple, their servers are the ones retrieving emails so they have access to the email contents (perhaps for training data?)
Even client side, that doesn't explain (as per article) a complete do-over as a web app wrapped in a browser.