I think we need to consider that there is a difference between "best before" and "Expiry" / "Use by"
Best before and Use by tend to be for foods and lets be honest they never used to put dates on things but your eyes and nose tended to let you know if something was off and likely to cause you harm but anyway.
Best before is often used for canned goods and they claim it's the date up to which the quality should remain the same but you may start to see changes in colour and loss of flavour etc
Use by tends to be for more perishable goods such as milk, however so long as your fridge works correctly and you put milk straight back into it rather than letting it sit on the side for 30 minutes mid summer while you eat your breakfast and then wash the pots etc it should still be OK and safe to consume for a day or two after the use by date. Again the sniff test should tell you whether it's OK or
Expiry dates are an official "Don't use after this date" statement relating to both efficacy and safety however the reality is that as with a food use by date there will be a good margin for error built into that date as they will know many people will assume it's still OK as it's only 6 months out of date etc and i've got the screaming shits and can't pop out for some Imodium so what's the worst that can happen
There does appear to have been a general tightening up of expiry dates however and simple medicines such as Paracetamol used to have a 5 year expiry date 30 years ago however that's more like 3 years now
Toxicity as already mentioned is a potential problem and can make some medicines harmful, aspirin for example can start to degrade and produce FSA (Free Salicylic acid) which basically smells like vinegar but can potentially kill you
Whether the medicines have been stored correctly is also a major factor so heat; humidity and sunlight all contribute, expiry dates will factor in that the medicine may have been stored in a bathroom cabinet regularly exposed to heat and humidity from baths and showers etc
Of course there are then some medicines which may begin to degrade more once opened and exposed to microbes and oxygen etc, these will more likely be liquids rather than a solid dose tablet however they may carry an additional instruction not to use after a certain time frame after opening, eye drops are an example