Sooner or later someone asks you for "the messages", usually a lawyer, a mediator or a small claims court. A pile of screenshots is what most people hand over. It works badly, and it is worth knowing why before you need it.
This is not legal advice. What a court accepts depends on the country, the court and the case. Check the court's rules or ask a lawyer what format they want before you export anything.
What a usable export needs
These are the things lawyers and courts tend to care about. Treat it as a checklist to confirm with them, not a rule.
Date and time on every message , with the time zone stated. "Yesterday" or a time without a zone is hard to rely on.
The real sender : the phone number or handle, not only the name you saved the contact under. Names change, numbers are harder to dispute.
Continuous numbering , so a reader can say "message 214" and a missing page is visible.
No gaps .…