For a Ryobi, it'd make sense that Home Depot would be cheaper since anyone selling it on Amazon is a reseller; Ryobi is sold exclusively by Home Depot in the US.
I've seen the same with Scotts, Fiskars, and a few other brands. Also, things like planes, chisels, etc. seem to be cheaper at B&M stores. On the other hand Amazon does have a wider selection.