For a research problem, I found that two real matrices $A$ and $B$ that I generated in due to some procedure always had the property that $AB = B^T A$. Is there any property of matrices $A$ and $B$ due to which this condition holds? I tried doing some matrix algebra, but noticed in my research problem, the matrices $A$ and $B$ are also both singular, so I don't really know how I would proceed on finding any such properties of $A$ and $B$.
Edit: I also verified $B$ is not symmetric and $A$ is symmetric.