Haneda airport(HND), official name is Tokyo International airport is located in shore of Ohta ward of City of Tokyo, adjacent to Tokyo bay.
Haneda was used as the gateway to Japan till opening of New Tokyo International airport, current Narita airport in Chiba prefecture in late 70s. Then, Narita became the gateway of Japan and therefore all international flights moved from Haneda to Narita except flights to Taiwan(mostly to Taipei).
Japan recognized Taiwan as the Chinese government but later shifted to approve Beijing as the official capital of China, recognizing People's Republic of China as the successor of Republic of China. Therefore Japanese government tried Taiwanese airlines to avoid to fly in and fly out from Narita, the official gateway, showing some respects to Beijing.
Haneda was connected by Tokyo monorail and Keihin-Kyuko line, close to the downtown of Tokyo. On the other hand, Narita is far, approximately 70 km away from the downtown. Japanese government once tried to build a Shinkansen line to Narita airport but the project was finally turned down due to the huge deficit of Japan National Railways, predecessor of current JR group.
Also Narita faced a big, serious problem. The landowners refused to sell their lands to build the airport and therefore construction took long time and also with bloodshed. Left wing activists supported the landowners and fought with the riot polices. Therefore opening of Narita airport was delayed and runways were kept as minimum. Also there was a security check to enter the airport.
Due to the struggle of Narita airport, Japanese government later focused on expanding Haneda airport. Especially the time had come when Japan hosted the soccer world cup with South Korea in 2004. International flights to non-Taiwan were resumed and as its location, locating at the bay, far from residential zone, aircraft can take off during the night. Narita has limited operational hours, but Haneda not. Then, thanks to its better location than Narita, international flights to Haneda is increasing each year. Some airlines already shifted back to use Haneda, instead of Narita.
On the other hand, Narita is now concentrating on LCC flights and built the terminal 3, especially for LCC airlines. Therefore the number of passengers using Narita is increasing too.
By the way, if you are looking a flight to Tokyo, three letter code for Haneda is HND, Narita is NRT and for all airports in Tokyo(HND+NRT) is TYO. Therefore recommend to use TYO to input when you are looking for the cheap tickets.