Consequently , by Allah 's grace , they routed the unbelievers , and David killed Goliath ; and Allah gave him kingship and wisdom and taught him whatever other things He willed . And if Allah had not been repelling one set of people by means of another , the earth would have been filled with chaos .