Why they come before baby is born - to get to know you, so you get to know them, gives them a sort of "base line" on pre baby personality/habits/any issues with you. Let's you have time to become comfortable with them before you're dealing with a crying baby, leaky boobs and stitches in awkward places!
Why to your home? Your environment says a lot about you, let's them see how you usually keep your home - again a baseline for before baby. Everyone's standards are different. Eg if you're normally a very tidy, clean person and it all goes totally out the window far beyond your normal after baby that could indicate you're perhaps struggling, but equally if you're a "little bit of mess and chaos never hurt anyone" type and what to the first mum is 'totally out the window' is just slightly messier than usual for you that's less concerning (I am of course not talking about dangerously hazardously messy or unsanitary). They'll notice things like if laundry is being regularly done, if dishes are piling up - not to criticise but as external indicators of possible difficulties a new mother is experiencing. They may also notice things like if there's smoke detectors fitted, when baby becoming mobile if suitable accident prevention is in place. People are also usually more relaxed at home so it means they get a more accurate sense of who you are rather than the front you may put on (even unconsciously) in another environment.
As pp said they're highly trained and usually very experienced and so may notice things you wouldn't necessarily. Plus a fresh pair of eyes can be useful.
In my case the reverse was noticed and rightly flagged as an issue. I was always quite a neat and tidy type but after having dd I went into overdrive, home was COMPLETELY spotless. Dishes were washed up immediately, even just a cup and the sink and counter cleaned too, carpets hoovered at least once a day, everything else even handles and light switches cleaned daily. It was at this time my OCD began to be looked into.
As with any profession some are better than others. I didn't like my first, and I DID wonder not only how she got the job but why she went for it. She didn't seem to like kids, had none of her own (older lady so not a case of just 'not yet') and seemed to think books and their authors knew better than mothers or people with ACTUAL experience with children! After the 3rd visit from her I refused to have her any more when she made a stupid comment about it being unnecessary to bf past 3 months!
My 2nd was a godsend! Had 5 of her own and had been doing the job many years, had fabulous practical advice including 'wee tips and tricks' that weren't widely known particularly but worked well.
She was the one that on her 2nd visit mentioned that she'd noticed the house was particularly spotless and was savvy enough not to allow me to brush her off. As a result a whole load of stuff came flooding out that I'd never told anyone until then, which she was so supportive in helping me with, without pushing me into doing anything I wasn't yet ready for.
She could easily have made me feel like I was a crap mum , instead she empowered me to relax on some things and eventually to seek further help from my dr. She helped me to be a better mum without ever making me feel I was a bad one.