The expiration date is set by the manufacturer as the last date when they are willing to warranty the film to function as rated in terms of overall sensitivity and curve. In general, films that have passed expiration will have varying amounts (depending on what film, and how it was stored) of loss of speed, increased fog, and decreased contrast. If storage has been relatively poor, there may also be other effects. I've seen film that was imprinted with the backing print from the next wrap in due to chemical bleed (gas hypered Tech Pan, the presumption was that something in the ink on the backing paper reacted with the hypering gas), film that had periodic patches of fog, worse at the outside of the roll as it had been stored, and film that was so completely fogged to develop as solid black. Over the long term, fogging due to cosmic rays can be an issue even in deep freeze storage (which pretty well stops chemical aging), and the faster the film and less reciprocity failure it has, the more fogging can be expected. Thermal fogging is also possible, with more effect the longer the film has been kept at or above room temperature, as well as more effect for faster films and those with less reciprocity failure.
That said, many modern films seem to age gracefully, and few indeed are the films that are significantly degraded within a year or two of expiration if they've been stored cold and protected from chemical influences. I've shot lots of TMY that was up to two years past date, and with decent treatment (refrigerated or frozen until ready to use, then up to a couple months in my camera bag before exposure, followed by processing within a week or two of exposure) have seen no degradation I could be reasonably sure was the fault of the film. I'm working my way through a 100' bulk roll of old Tri-X at least five years out of date, and though it has some overall fog, it produces very nice negatives in HC-110 and Caffenol -- and I've got another identical roll in the freezer that I expect to be perfectly fine when I load it up in a year or so. I've also shot Portra 400 that was up to a couple years out of date with perfectly marvelous results, and gotten very acceptable results from no-name cosumer grade 35 mm ISO 400 C-41 (probably Agfa, but no way to be sure) that had been in storage at room temperature, in my camera bag, for at least ten years.
My take is, if you're shooting for yourself, for enjoyment, especially in B&W and doing your own processing, there's no good reason not to buy expired film within a couple years of the date -- you can compensate your exposure and process if you find a batch has lost a lot of speed or has high fog, and you might even find you like some of the effects that you see. If you're shooting images for sale or hire, there's no excuse to take the chance of getting a bad batch in order to save a few dollars.