Let's start with the most obvious question: what is her secret? It's biology.
Men and women are wired differently biologically to find different things attractive. To wit: at dating sites, women most fear that the guy will be a killer. What do men most fear? That she'll be fat. (reference) Why do I start with that? Because it's important to understand that the things women find attractive and unattractive are very different from the things that men find attractive and unattractive.
Look also at what's considered "normal" societally when it comes to dating. Older man dating a younger woman? Kinda creepy, but it happens - especially if he's wealthy. Older woman dating a younger man? There are a couple of examples, but for the most part, men don't gravitate toward older women - rather it's the opposite.
So her secret is that she's out of interesting range for most men, except those older than her. And in that case, the pool of what they consider possible is very large. Additionally, most men aren't interested in someone else's kids, until those kids are close to grown up. So that's another factor.
In short, you've got about 30 years to duplicate that.
So, to answer the second question of: how do I dress how I like, be friendly to everyone, yet not attract all that attention?
First of all, keep in mind that visual cues mean a lot to men. So... dressing like going out clubbing will signal one thing; dressing professionally will signal something different. It's easy to blame men for this, but let's stay away from blame and talk about information and facts. And a fact is: if you're showing off a lot of skin, you're going to attract attention - whether that's right or not. That said, it's still very possible to dress beautifully yet professionally. The successful women I work with do so on a regular basis.
Yet we also want to ensure that attention is circumvented and quickly. You know that you're there to work and not flirt - now it's time to send that message. It's possible to be attractive and professional - I've seen that for close to 40 years. And the clue here is in your response.
The women that I've seen to this successfully give off a vibe of "not interested". If someone is there to talk about something other than work, they quickly steer the conversation back to work. They're friendly and gregarious, yet discourage needless conversation. "Is there something I can help you with?" "Is there something you need?" "[X] knows more about this; please check with him/her" "If you'll excuse me, I have a LOT to do and limited time." "If you're going to ask me for help, I'll want to see what you've tried first" "Thank you for offering; I don't recall asking for help with this" Those aren't cruel or mean yet they send the message of "I have more important things to do than engage in conversation with you right now." I've seen that be very successful with some very attractive women (who happened to be cube neighbors) that were pleasant yet had to regularly fend off visitors.