Online grocery sales surged nearly 19% last year to $325 billion, driven by shifting consumer behavior and improved delivery infrastructure.