In excepts of Spare obtained by The Guardian pre-publication, we learn that according to Harry, King Charles, who was the Prince of Wales at the time of his second son's birth, immediately gave him the nickname of "the spare." Referring also to Prince William, Harry's older brother and the eventual heir to the British throne, the now-monarch allegedly joked to the late Princess Diana in the delivery room, “Wonderful! Now you’ve given me an heir and a spare — my work is done.”
Indeed, William is the heir, making Harry the spare, which also points back to a long tradition of second siblings feeling like they have no true identity within the royal family. Another poignant example is Princess Margaret, the younger sister of the late Queen Elizabeth.
It's worth noting that interestingly, Harry is far from the spare any longer. Even if William weren't able to eventually fulfill his duty as the rightful heir to the throne, the line of succession would pass to his children in the order of their birth. So, Prince George, Princess Charlotte, and Prince Louis would all assume the throne before Harry, who is currently fifth in line to become sovereign, with his son Archie and daughter Lilibet being sixth and seventh in line, respectively.