Avengers 4 title Avengers: Endgame was a long kept secret and it was said it can spoil the Infinity Wars:
But how? How come this title was so big deal? Is this title have anything to do with some comic-book reference?
"Endgame" isn't a reference to the comics, but to Infinity War. Specifically, Dr. Strange's remark upon surrendering the Time Stone:
We're in the endgame now.
This line - and his parting remark, "This was the only way" - were taken as indications that his actions throughout Infinity War, including surrendering the Time Stone, were all part of a complex long-term gambit to achieve the one timeline where Thanos is defeated. The fact it's now the title of the sequel would appear to confirm that theory.
In chess the endgame is considered a phase of the game where it can be important to sacrifice a powerful piece in order to win the game. Many see that as an indication that while we might see a victory for our Marvel heroes, they might need to buy that with some true lasting sacrifices, e.g. loss/deaths of characters that won't be undone.
There's also some other associations with a chess endgame:
Before Infinity War came out, there was no indication that this would be a two-part story. As far as anyone knew, Avengers 4 was just going to be another Avengers movie. Viewers going into the first movie didn't know that the heroes wouldn't be victorious in the end.
But the title "Endgame" suggests that it would be the ending of the story from Infinity War, which in turn gives away the fact that Infinity War isn't a complete story by itself. That implies that the good guys didn't win -- effectively giving away a major part of the ending of the first film.