If you're walking down the street and see one car run a red light and plow into another, you are a witness to the accident. You saw it and can tell someone else how the accident happened.
The first part of a witness's role is observation. You witness the accident. The second part is telling someone about it — bearing witness. In court, you can be a witness for the defense or prosecution. You can also witness a legal document, like a will, or a wedding conducted by the justice of the peace. Religious people use this word a lot too: being a witness in that sense is being a true believer who tries to convert others.