A Canaanite city which existed before Abraham's time (Genesis 12:8; 13:3). "Ai" means "ruin," which might mean it was an important or noticeable ruined place. When Abraham traveled through the area, the people of Ai and other Canaanite cities (Shechem, Bethel, Jerusalem) did not stop him. Maybe Abraham talked to their kings and showed he came in peace. Or maybe Abraham had so many people with him that the Canaanites were afraid to fight him.
Later, when Joshua led the Israelites into Canaan, they attacked Ai. It was the second city they fought against. The first time they attacked, they lost. This was because an Israelite soldier named Achan had disobeyed God by taking things from Jericho. After dealing with Achan, the Israelites attacked Ai again and won (Joshua 7:1–8:2). Joshua caught the king of Ai, killed him, and burned the city (Joshua 10:1).