This expression is hard to explain, so let's begin with some examples:
You speak English pretty well for a non-native.
This is pretty good... for an American beer.
You use phrases like this to compare something to the category that it belongs to. It expresses the idea that something is better than other things in that category, but not better than things outside of that category.
So in the example "You speak English pretty well for a non-native," the category is "non-natives". The sentence means "You speak English better than most non-natives. However, you don't speak as well as native English speakers."
In the second example, the speaker is talking about an American beer. He or she is saying that the beer is better than most American beers, but not better than beers from some other places (like German beers, for example).
The most typical example of this expression is "You're pretty good for a girl." Men say this to compliment a woman who's able to do things that men usually do, like playing certain sports.