Why do credit cards have expiration dates?

An issue I’ve had with the new 3 digit security code is that it is right in line with the signature and now both get rubbed off after multiple uses at the ATM.