In wa-mā al-ḥarbu illā mā ʿalimtum wa-dhuqtum, the negative mā and exception illā produce restriction: war is nothing other than the reality already experienced. Al-ḥarb is the topic; mā ʿalimtum wa-dhuqtum supplies the meaning of its predicate.
In the second hemistich, wa-mā huwa … bi-l-ḥadīth al-murajjam separately denies that the statement is speculative; the bāʾ strengthens the negative predicate. One clause asserts firsthand knowledge, the other dismisses conjecture.