For the younger folks: Kerry got some seriously badass medals for his military service in Vietnam. People who had been on the same boat as he did, but at a different time, worked with the Republican party to claim that he hadn’t really done what he did. The press ate this up, and distributed it widely, costing him public support and likely the election.
And for people not military adjacent, 20 years is the length of service for full retirement. That’s how long people who go the distance with the military stay in. He was already 4 years past that.