The exceptions to the rules
Given that, a good rule of thumb to follow is that the more crucial the medication is to your health and safety, the more diligent you'll want to be about checking and abiding by expiration dates. You'll also want to be more of a stickler when it comes to liquid medications, especially ones that list water as the first ingredient, as those will destabilize more quickly than their pill-form brethren.
There are also certain types of medications, like insulin and anticonvulsants, that shouldn't be used past the expiration date. Your doctor and/or pharmacist can assist you in learning which expiration dates should be more closely observed than others.
But, like, why is there an expiration date on my shampoo?
Cosmetic products like shampoo, acne treatments, sunscreen and even soap lose effectiveness over time due to exposure to heat and moisture. In the case of things like shampoo and soap, the result won't be much to worry about -- eh, so your hair doesn't get as clean as you might like, big deal. But if a product like sunscreen doesn't work, then you're in trouble in the form of a wicked sunburn.