From time to time, due to floods and invaders, the structure of the Kaaba continued to deteriorate. So the Quraysh tribe repaired its structure using masonry and wood and built a gate above the ground to protect it from intruders and floods. Read more: https://www.scoopearth.com/history-of-kaaba/