Just days after Defense Secretary Ashton Carter called into question the Iraqi army's will to fight, the Army's top general said the Iraqi government must gain the confidence of its people for its army to be successful.

"As you look at this, you could say there probably is a problem with leadership," said Army Chief of Staff Gen. Ray Odierno, who served multiple tours in Iraq, including as the top commander of U.S. and coalition forces in country. "They have to have the will to fight. It always goes back to the government of Iraq. Unless you get everyone to believe the government of Iraq is there for all Iraqis, you're always going to have this problem."

War is a clash of wills, Odierno said.

"You have to have the right leadership, you have to have strong military leadership, you have to build technical competence in your forces, and you have to have the will and desire to fight," he said. "If you're missing any of those things, you're not going to be successful."

Carter's remarks about the Iraqi army came after the Islamic State terror group captured Ramadi without much of a fight.

"What apparently happened was that the Iraqi forces just showed no will to fight," Carter told CNN's State of the Union, according to a report in USA Today. "They were not outnumbered but in fact they vastly outnumbered the opposing force, and yet they failed to fight."

Odierno said the military is still analyzing what happened in Ramadi.

"I'm not going to sit here and tell you exactly why things fell apart in Ramadi," he said. "But it's clear to me that we have to help them ensure they have the right leadership. That plays a role in the will of people to fight."

Odierno said he was most optimistic about Iraq's future in September 2010, as he prepared to relinquish command of U.S. forces in theater.

"I felt very good about Iraq, and I felt we were absolutely on the right track," he said.

But Iraq's leaders have not been able to overcome the mistrust they have between the different sects, he said.

"It's incredibly disappointing to me, personally, what I've watched happen," he said. "I really believed, at that time [in 2010], that in five years or so, Iraq would be doing very well. But, frankly, they fractured."

Despite the setbacks, Odierno said the U.S. must continue to support the Iraqi military and government.

"We want to help them as much as we can to prevent ISIL from expanding," he said. "I think it's worth our time to continue to work with them and to provide them some capability."

He is opposed, however, to putting combat formations on the ground to lead the fight, Odierno said.

"You have to be careful to not be an accelerant," he said. "What we have to do is support [the Iraqis] and help them."

It will take time to train the Iraqi forces, Odierno said.

"We said early on this will take three to five years," he said. "It takes a while to train people to the capacity necessary to regain the ground that they've lost."

As for whether the U.S. should increase the number of troops on the ground who are training and advising the Iraqis, Odierno said he and other military leaders must "constantly assess" what is needed.

"We believe [the Iraqis] do better when our advisoers are there," Odierno said. "We just need to determine how many we need over there."

So far, commanders on the ground have not asked for more trainers, nor have they asked for troops to serve as advisoers who would be embedded with Iraqi forces as they fight.

"We have to decide how much we gain from that because that obviously puts us more at risk," Odierno said. "Embedded advisoers, with increased risk to our soldiers, probably would make us more effective, but that's a decision process we have to go through."

Leaders must carefully weight any request for embedded advisoers, if one is made in the future, Odierno said.

Iraqi is "incredibly complex," not just because of the Islamic State but also long-term sectarian rivalries and issues, making this a difficult fight, Odierno said.

"That's why these decisions, you have to be very careful about," he said. "I don't want to put our soldiers in the middle of that. That's why [the Iraqis] have to solve this problem."