One of the most powerful and sustainable ways a country maintains a shared, holistic identity across their varying communities is by prioritizing that its people learn/feel a shared sense of history. At the same time, a country's success rate in achieving this is always changing, as its people's experiences within it vary widely based on their race, gender, income, and education -- especially in the United States. Americans' interpretation and understanding of historical events is far from universal, and that problem is likely to get worse, as more people digest separate sources of content and information about what is going on in the world than ever before.
JFK, though, still has a unique grip in uniting Americans -- even in 2022. He is only second to Abraham Lincoln in recent polls of favorability scores for past presidents, and that is especially meaningful when many Americans alive today witnessed his presidency. He remains the rare president that embodies something as close to a shared history as Americans have -- as his political highs, lows, and death were all captured in the very early years of television.
By no means did Kennedy have the most "successful" presidency, but it somehow still means more than almost any other, and not just in our imagination. Kennedy's death inspired the passage of foundational legislation in modern American society that grew the size and prosperity of the nation's middle class to new pinnacles, and though we don't know if they would have happened had he lived, the fact that his presidency and death helped push them to reality should not be undervalued.