Historians are not sure where the saying originated, but it means that revenge is best served not fresh after the insult occurred, but after enough time has passed so that the target won't see it coming.
Victim: "Why did you destroy my marriage? I thought we were BFF
Vindicator: "Because you stole my boyfriend back in the 6th grade."
Victim: "But that was 20 years ago!"
Vindicator: "Revenge is a dish best served cold, bitch."