Why months left matters
Many countries want your passport to stay valid for some time after your trip, often 3 or 6 months. If it doesn't, the airline can refuse to board you even if the passport hasn't expired yet. The US State Department notes that some countries want your passport valid at least 6 months beyond your travel dates.