Something to think about - sometimes in life we have to be able to detect subtle differences in things (environment, objects) while other times we have to look for sameness or similarity. Discrimination involves looking for subtle differences to be able to tell very similar things apart such as wine, cars, antiques, etc. In day to day life we have to learn the difference between a variety of noises in the house, is that beep the microwave or the smoke alarm? It is important to know because they elicit different behaviors. We might want to be able to discriminate which noise is the back door closing, versus the front door closing, as they might elicit a different behavior. It is important to be able to tell the difference between similar things because they elicit different behaviors. (Note: I'll add more about discriminative stimuli in a bit).
Generalization is important because there are times when we need to lump certain things together based on their similarity. There are many instances in day to day life where we generalize. For example, there are many kinds on milk. Usually when we are home and want milk we drink what is on hand even though it might be non-fat, 1%, 2% or whole milk. Milk is milk for the most part, we can tell the difference, but our behaviors are the same when we are at home and need to add it to our cereal in the morning. Another example is that there are many shades of red, bright red, dark red, pink etc. However when we are driving around town and see a red light, we don't tell the officer that it wasn't the right shade of red so we blew through it. We generalize the different shades of red into a broad category of red and in the context of stop light stop when it is red.
However, there are times when we might discriminate different types of milk when there is a choice, say when we are at the market deciding which brand and what type of milk to buy, however once we get home and have less choice, we typically generalize. We might generalize red in the context of street lights, however if we are getting dressed in the morning, it might matter a great deal if we are putting on a red shirt or a pink shirt.
Why is this important in the context of behavior modification? We are constantly looking for cue (clues) in the environment on how to behave. We don't just jump around emitting random behaviors all the time like we are at some wild rave party. Our behaviors are typically under the control of environmental stimuli since the environment will often govern behavior based on the consequences. Once a stimulus regularly and predictable controls behavior we stay that the behavior is under the control of the stimulus (stimulus control). When you are at the store you are under stimulus control, you put on a shirt and shoes, you don't smoke, you typically don't open food and eat it, for sure you don't open the milk and smell it to see if it is fresh. Because you are under stimulus control, there are some behaviors you do and some behaviors you don't do.
Sometimes it is important to discriminate between different stimuli to know which behaviors to emit. Just like stores are a particular class of stimuli, they share common characteristics. However, depending on the particular store you are in, some behaviors may be elicited that might be punished in other stores. Some stores allow you to try on cloths before you buy them some don't. Some stores will let you use their restrooms and some don't. Some stores the employees will come by and help you, some won't. Understanding the sameness (generalizing) and understanding the differences (discrimination) are extremely important in our day to day lives.
When a stimulus 'tells' us what behavior to emit by clueing us in on the consequence, that stimulus is called a discriminative stimulus. This is to say if a sign says 'open' we know we can go in and shop around. If the sign says 'closed' we know we can't shop. Any open sign and any closed sign will do, so in this case we are essentially generalizing open signs and closed signed. They are nonetheless discriminative stimuli.