Vayikra5:1

וְנֶפֶשׁ כִּי־תֶחֱטָא וְשָׁמְעָה קוֹל אָלָה וְהוּא עֵד אוֹ רָאָה אוֹ יָדָע אִם־לוֹא יַגִּיד וְנָשָׂא עֲוֺנוֹ׃

And when a soul sins in that it hears the voice of an oath, and it is a witness, having seen or known, if it does not tell, it shall bear its guilt.

Vayikra 5:1

וְנֶפֶשׁ כִּי־תֶחֱטָא וְשָׁמְעָה

Vayikra / Leviticus 5:1 · Pshat

Vayikra 5:1

וְנֶפֶשׁ כִּי־תֶחֱטָא וְשָׁמְעָה קוֹל אָלָה וְהוּא עֵד אוֹ רָאָה אוֹ יָדָע אִם־לוֹא יַגִּיד וְנָשָׂא עֲוֺנוֹ׃

And when a soul sins in that it hears the voice of an oath, and it is a witness, having seen or known, if it does not tell, it shall bear its guilt.

Pshat פְּשָׁט

The witness who kept silent

Sometimes the sin is not in what was done but in what was not said. The Torah speaks of a witness who knows the truth and keeps silent.

Rashi: it speaks of a witness who was adjured with an oath that if he knows testimony, he would give it. Ibn Ezra: the oath (אָלָה) is a ban under a curse, and whoever does not tell bears punishment from the Eternal, even if he forgot and later remembered.

How Rashi and Ibn Ezra explain it

Rashi And hears the voice of an oath

In a matter where he is a witness: they adjured him with an oath that if he knows testimony for that person, he would give it.

Ibn Ezra And when a soul sins in that it hears the voice of an oath

This is a ban under a curse (חֵרֶם), and likewise "and you uttered an oath" (Shoftim / Judges 17:2). Scripture took a short way and warned that the witness is obliged to tell, for if he does not tell, there is punishment on him from the Eternal, "he shall bear his guilt," if he forgot and did not tell and afterwards remembered.

Takeaway

An oath (אָלָה) is a vow with a curse on whoever breaks it. A person who needed a witness could publicly adjure all who knew the truth to come and tell.
In the book of Judges the mother of Michah pronounces an oath against whoever stole her silver, and her son confesses (Shoftim / Judges 17:2).
The witness "saw or knew": he saw with his own eyes or knows from the person's own admission.