Using a phone or tablet's camera as a scanner replacement is nothing new – there are plenty of apps designed for this purpose. They typically use edge detection to isolate the document from its background, and crop and warp that area into a rectangle.
Real scanners also do edge detection, but as the imaging unit is perpendicular to the document they don't need to adjust the shape.
Google's PhotoScan is the latest entry to this arena, and as its name suggests is designed for capturing photographs.
That last point is particularly important as so many photos were printed on glossy paper.
This video explains how the magic works:
The idea is that captured photos are saved to Google Photos, which has just been updated in its Android, iOS and Web implementations.
Auto enhance has been improved to give better looking photos, smart "looks" automatically adjust a photo before applying filters such as monochrome or warmer or cooler tones, and light and colour editing controls allow fine tuning.