For me it's usually either because I'm feeling lazy or because it's something very specialised that's hard to source locally
For example I wanted a new cycling helmet, and the only satisfactory helmet I found in local shop was ~200eur. I could have ordered online instead and found something in sale for maybe 100eur instead, if I just waited for a week for delivery