Um, there is the FDA regulation to consider rather than just "marketing tools".
https://www.accessdata.fda.gov/scripts/cdrh/cfdocs/cfcfr/CFRSearch.cfm?fr=211.166
According to the FDA, the drug manufacturer must put the expiration date on the drug and perform a reliable, meaningful, and specific stability test when determining the date to put on the drug. The stability test can be at expected extreme conditions (such as a hot, damp room for years). Or the stability test can be accelerated (such as higher temperatures than expected at a typical user's location) as long as the manufacturer is currently conducting an actual stability test and then uses the actual test results when known.
What makes a drug unstable will depend on the type of drug. If liquid, the solvent may evaporate or sterility may be compromised. For all drugs, there may be chemical reactions such as oxidation that degrade the drug. As pills usually don't have sterility or evaporation type issues, a solid pill probably has its expiration date set to where it no longer meets the minimum effective dosage due to slow degredation.
A rule-of-thumb is that it loses ~10% of effectiveness each year if you have nothing else to go by. But the expiration date is actually supported by actual tests, not marketing.