Brahman is called the Knower, or the Witness because it is the Perceiver - the very definition of Brahman. It is not a quality, it is Its very essence. Swami Vivekananda says (Complete Works, V7, p 55 - available here, Volume 7, 'Inspired Talks', 'Wednesday, July 17 - https://advaitaashrama.org/cw/content.php):
Shankara further asks, can you see existence separate from everything else? Where is the differentiation between two objects? Not in sense-perception, else all would be one in it. We have to perceive in sequence. In getting knowledge of what a thing is, we get also something which it is not. The differentiae are in the memory and are got by comparison with what is stored there. Difference is not in the nature of a thing, it is in the brain. Homogeneous one is outside, differentiae are inside (in the mind); so the idea of "many" is the creation of the mind.
Differentiae become qualities when they are separate but joined in one object. We cannot say positively what differentiation is. All that we see and feel about things is pure and simple existence, "isness". All else is in us. Being is the only positive proof we have of anything. All differentiation is really "secondary reality", as the snake in the rope, because the serpent, too, had a certain reality, in that something was seen although misapprehended. When the knowledge of the rope becomes negative, the knowledge of the snake becomes positive, and vice versa; but the fact that you see only one does not prove that the other is non-existent. The idea of the world is an obstruction covering the idea of God and is to be removed, but it does have an existence.
Shankara says again, perception is the last proof of existence. It is self-effulgent and self-conscious, because to go beyond the senses we should still need perception. Perception is independent of the senses, of all instruments, unconditioned. There can be no perception without consciousness; perception has self-luminosity, which in a lesser degree is called consciousness. Not one act of perception can be unconscious; in fact, consciousness is the nature of perception. Existence and perception are one thing, not two things joined together. That which is infinite; so, as perception is the last it is eternal. It is always subjective; is its own perceiver. Perception is not: perception brings mind. It is absolute, the only knower, so perception is really the Atman. Perception itself perceives, but the Atman cannot be a knower, because a "knower" becomes such by the action of knowledge; but, Shankara says, "This Atman is not I", because the consciousness "I am" (Aham) is not in the Atman. We are but the reflections of that Atman; and Atman and Brahman are one.
To ask 'how' is not relevant. Questions as to 'how' are within and bound to be within the sensual universe of time, space, and causation. Brahman is beyond the sensual universe. Brahman 'is'