I think what a lot is, by just looking around by yourself, they think you're "up to something" ie, going to steal something. Probably some portion is that. I used to, when people asked if I needed help finding something, I'd say no and I'd look suspicious. Eventually I figured out to just let the salesperson do his job, and take me wherever. Makes my life easier, as he knows where it is and I don't.
Even if their ideas aren't as insidious as thinking you're going to steal something, a lot of times the salesperson just wants to develop a rapport with you. Make some smalltalk, tell you about sales that are happening, whatever. So by establishing the personal connection, you're more likely to come back to the store. Personal connection helps you, too, as especially in the case of a smaller business, you often get "good guy pricing" and, let's say you wanna buy a drink, and you only got $2 on you and it's $2.50, they'll often just let you go at $2, or they'll let you have for free, say, sandwiches or bread they're gonna throw out, things like that. I understand totally how sometimes you wanna just be left alone to look around, and to a point, salespeople do, too. The solution for that, if you don't want the salesperson helping you, tell them "Ah, thank you very much, but I'm just looking around/browsing right now, thank you though." Better, though, is let the salesperson find you the initial item you're looking for, and if you still wanna look or examine more stuff, after they guide you to the item you want, you say "Ah, thanks for helping me, I'm gonna look around a bit more by myself if you don't mind, though, thanks." Or something to that effect. If they immediately hand you the cheapest item, and you don't want it, just say "oh, thank you, but I'd like to look at the others and compare them a bit before I buy."
So yeah, the solution to the problem is basically, you gotta communicate with the salesperson.