Majestic - I hope ok for me to answer (purely own experience of course - but not just as a sufferer).
How would they know?
Sometimes it's visually obvious (shaking, tics, rituals)
sometimes because we need 'reasonable adjustments' to be made (catch 22 - you need the adjustments but can't get them without telling them why obviously)
some employers require medical checks, some medications mean for your own safety you need someone at work to know (in case of emergency - some meds are contraindicated with other meds likely to be used in an emergency, some have side effects that have physical effects that can be risky)
in my own case the difficulty with employers is the gaping CHASM in my cv for which I have no other explanation
For letting agents/landlords as a benefit recipient I need to usually declare that, this usually leads to an awkward discussion of why a seemingly healthy woman in her 30's/40's wasn't working and wasn't looking for work, they don't want to rent to someone who is 'just lazy', or an addict (big issue where I live), or earns money through crime, also certain properties are unsuitable as I wouldn't feel safe in them. I'm also physically disabled so eg can't do lots of stairs this affects how I feel in terms of if I can manage a property and getting in/out of it which impacts my mental health.
Finances - I can get quite panicky just checking my bank balance so I'll avoid doing so and then not notice a payment that should have come in being late or absent, or not notice a bill has gone out early or indeed a dodgy payment, or being charged twice for something. If I haven't slept for a couple days my concentration is off obviously so if I tried to balance my budget when I was like that it can be disastrous. Some meds can make you foggy. I've a friend who has bipolar and she has been caught out with spending sprees caused by being in a manic state, this can happen with other conditions too. Being on benefits means money is tight so there's the temptation to borrow and the lack of full awareness to know if you can really afford to repay a debt, I ran up debt several years ago on a credit card when I was mid breakdown, I don't even remember applying for it, much less spending on it. It was given to me by my then bank, people who saw what I was like then were shocked they gave it me as I was so CLEARLY very ill. (Ironically that same bank is currently running a virtue signalling advertising campaign supposedly in aid of raising awareness of mental illness). I know of someone else with bipolar who during a manic episode literally emptied his bank account and gave the money away to strangers on the street. People with mentally illnesses are more likely to get into debt, more likely to try and ignore the debt and throw away unopened letters etc. However, equally what then happens is you tell financial institutions (or someone else does on your behalf) that this is why you're struggling repaying debt and that info is then attached to your data. So then when you are well again and trying to open accounts etc it's harder (I appreciate it's tricky) Martin Lewis has taken a genuine interest in this area and continues to campaign on behalf of people with mental illness being taken advantage of by less scrupulous lenders.
Relationships - that's tough. When someone gets to know you, they will of course notice visually apparent signs and naturally ask why. Sometimes we'll do things that frighten them (a feeling of invincibility is a symptom for some conditions and sufferers can do things like try to stop moving vehicles, jump off high objects etc), personally even just seeing how I wash my hands after visiting the loo can alert people (cliche of OCD but true for me), less cliche is things like not wanting to go in certain shops or restaurants, not wanting strangers to touch me or even stand close to me especially if they're visibly dirty. My condition can also make me 'flaky' if I have to keep checking I've turned the cooker off, or locked the door... I'm currently housebound as a result and that didn't happen overnight, it gradually gets harder to go out, I'm later each time... Panic attacks are impossible to hide. Plus there's also the honesty/integrity element - that can be pathological too - the need to tell people because you feel it's only fair they know. So they can make an informed decision about whether to be around you or not - because I do actually recognise it is very hard to be around.
So you see, even though MOSTLY mental illnesses are 'invisible' conditions sometimes they're all too visible. And it's embarrassing too. In particular I have been very conscious that I don't want my dd to be embarrassed by me (well no more than most teens would be anyway
). So I try to keep the obvious stuff to a minimum in public - but that also feeds into the fear of going out in public (and of failing her, letting her down).
Some people are lovely and understanding (usually those with experience either as a sufferer themselves at some point or close to someone who is/was), I had a lovely person at my new bank who was very helpful. She'd suffered a post natal psychosis and done some very odd things herself inc an incident where she believed she could fly. She was so nice.
Others are kind but awkward.
Sadly some, but still too many are downright cruel/prejudiced. I had a neighbour who took to regularly calling me "that nut job" to all and sundry.
Bit long, hope it was helpful? Informative?