Case A: Company A and B begin cooperating with each other and in a meeting, company A discloses an invention to discuss and move further.
Case B: Company A and B sign a NDA and do the same.
Is any of these cases novelty destroying?
I am not a lawyer so this might not be right, but it is my best guess.
In Case A, I'm assuming the meeting was internal to the two companies and no-one in the meeting then publicly disclosed the invention. In this case there is no public disclosure. Company A is trusting Company B to keep the invention private. This actually happens pretty frequently and there is usually an understanding that such information should be held private. If Company B publicly discloses the invention then it could impact patentability. Of course if Company A has a patent application already filed they are protected.
In Case B Company A is obligating Company B to keep the invention confidential with the NDA and has remedies if they don't. As George White states in a comment, at the very least an NDA documents that the disclosure was not intended to be public. An NDA is pretty much always a good idea.