Tisha B'Av did not exist in its present form during the time of the First Temple. The day of mourning developed from the experience of destruction and exile.
After the Babylonians destroyed Jerusalem, fasts were observed in memory of the disaster. The prophet Zechariah refers to several such fasts, including one in the fifth month.
The destruction of the Second Temple gave the observance even greater importance. Jewish people once again faced the loss of Jerusalem's sanctuary. This time the Temple was not rebuilt.
Rabbinic teachers connected several national disasters with the Ninth of Av. These included the destruction of both Temples, the fall of Betar and the devastation of Jerusalem following the Bar Kokhba revolt.
Tisha B'Av therefore became a shared day for remembering the loss of the Temple and other disasters that shaped Jewish history.