[Check the prices carefully. I bought toy for my dog at Walmart for 94 cents that was $3 at Dollar General for the same thing.]
Walmart will be cheaper for most things. Dollar General fills a specific niche - if you have to walk or take the bus or drive 20 miles to the nearest Walmart for one thing you need right now, the Dollar General round the corner will be cheaper or more convenient. They are killing pharmacy margins because Walgreens and CVS rely on non-pharmacy sales to make money. Dollar Tree tried adding a pharmacy to one of their stores and discovered that retail drug dispensing is unprofitable. Pharmacy chains have higher prices than dollar stores on non-pharmacy products but lower overall profit margins. The drag of high pharmacist and pharmacy tech salaries probably accounts for this. So dollar stores are kind of like the old five and dimes except dollar stores are ubiquitous to the point they compete with pharmacies and gas stations in the convenience store segment.