Generally speaking, a witness is indicating that they witnessed the event described in the document they are signing. A witness to a marriage is saying that they saw you got married. They are not saying that they are related to either of the parties getting married. They are not saying that they approve of the marriage. They are not saying that the bride’s dress compliments the groom’s tuxedo.
A witness to a will is saying that they know who the testator is and that they appeared to be able to sign the document of their own volition. They are not saying that they approve of anything in the will or that they are related to the person signing the will (although witnesses to a will generally can’t benefit from the terms of it.).
A witness to a deed is indicating that they saw the grantor(s) sign the document and that they know the grantor. They aren’t agreeing to the price. They aren’t saying the legal description is correct.
Witnesses may be related to the person signing the document. They may be warm bodies also in the same office on the day the document is signed.
Of course, if the same person witnesses several of your ancestor’s documents over time…that’s a clue that there was a potential relationship between the witness and your ancestor. But that witness whose name only appears once may simply be another person who was in the same place having legal work done on the same day.