There's a huge family of "Neurosteroids"[1], which impact various receptors in the brain in lots of super complicated ways that aren't entirely understood. They are synthesized in all kinds of ways naturally, and when it comes to "what they do" in terms of personality... "probably something" is the best we can do.
There is massive complexity in all these things, all kinds of feedback mechanisms, genes and enzymes involved, etc. They do something but it's hard to say what exactly.
I know about this personally; one of the amazing things about transgender medicine is that there is a huge range of responses to the hormones involved, and there's honestly no way to predict what will happen with a given person.
There are tendencies in aggregate - like less testosterone = less libido - but how those come about biologically is unclear and the effect varies tremendously between different people.
It's a joke to pretend like we fully understand or can predict how any of these things actually impact our lived experiences beyond very rough, bulk tendencies.
[1]https://en.wikipedia.org/wiki/Neurosteroid