When Winnie Ewing entered Westminster in 1967, her experience as one of a mere handful of women MPs was in some ways glorious, in others dreadful. In her first year as the only SNP Member of Parliament, she began to understand the inner workings of the world whose glass ceiling she had shattered. It was eye-opening. Heckled mercilessly from the opposition benches, she grew used to comments such as “The Honourable Lady should be on at the London Palladium”, or “The Honourable Lady should see a psychiatrist”. Some of her detractors were more wounding than others, but she responded in good humour, more than able to fight back with a keen wit of her own.

What she could not control, however, and what she had not expected, was to find herself the victim of a stalker. He was a fellow MP who had been angered, she suspected, by her declaring that the enemies of Scotland were not the English but “Scots traitors within the gate”.

Whatever the reason, the shadow behind her in the corridor, or sitting too close in the library, was at first creepy and soon became frightening. Late one evening, after being apprehended in the empty passageways of Westminster, she had to flee to the safety of the Speaker’s room. It was a harsh introduction to the intimidating culture she was now part of, and few people knew of it until Ewing published her autobiography, some 40 years later. Even then, she did not name her nemesis.

Role models don’t come much more glamorous or impressive than Madame Ecosse. Today’s political landscape stands as it does in large measure thanks to her determination and grit. She showed that there was no impediment to women occupying high office. Fifty years on, there has been a quiet revolution in the political sphere – matching that in almost every other domain. When I began to compile Scotland: Her Story, an eye-witness account of history as experienced by women from the early middle ages to our own times, three of our political parties were led by women, one of whom was also First Minister. We were soon also to have another female Prime Minister at Westminster.

Such a groundswell in women’s status would have been unthinkable only a few years before. Yet by the time Nicola Sturgeon, Kezia Dugdale and Ruth Davidson were in situ, nobody, with the possible exception of the hoariest dinosaurs, blinked an eye.

It’s not only in politics that the atmosphere and opportunities have changed beyond recognition. I had just started primary school when Ewing rolled up at Westminster in a Hillman Imp and high heels so new they hurt.

Since then, women’s flourishing has been remarkable. Not so long ago, the world of literature was almost as closed a shop as a Masonic Lodge. The smattering of female novelists and poets who were published were often cold-shouldered and belittled – read Robin Jenkins’s withering assessment, for instance, of Muriel Spark.

Now, with writers of the profile of J K Rowling or Jackie Kay, Val McDermid or Ali Smith, they lead the charge, here and internationally. In business, the wintry sea of grey suits has been enriched by the presence of those such as Ann Gloag, Ann Budge and Michelle Mone.

Turn on the radio and you’ll often find a female professor of astronomy explaining the universe – a broadcast that is as likely to be presented, edited, or produced by a woman as by a man. Meanwhile in sport, music, comedy, theatre, finance, the law, the church and universities, men are no longer the only ones at the controls. So far, the only Scot to have played in a world-cup winning football team (Italy, alas) has been a woman.

Those 50 years of achievement, however, have been hard-won. They represent an egg-cup of sand on a beach stretching back to the start of time. At no point in those past millennia, however, have women been quiet or meek. It only looks that way because they have gone unnoticed. Thankfully a rare few made it into the earliest records which, even if they were written by men, were obliged to recount some of their deeds. Thus you have the nuns at Coldingham Priory who preferred to slice off their own noses and upper lips than be raped by Vikings. Or you catch sight of ale-women, arguably the second oldest profession in the world, as the authorities tell them when they can sell their wares, and for how much, and the fines for breaking the rules.

In the middle ages as now, there were two parallel worlds. The lives of queens and princesses, aristocrats and nuns were inconceivably different from those of ordinary people. Though I’d rather have lived in a hovel warmed by the fug of family and beasts than in a cavernous castle or convent, from some perspectives they had it far better: good food, warm clothes, sound houses, and medical attention when they were ill. But in other ways their lives were unenviable. Some of those who championed Robert the Bruce, for instance, were punished by being hung for years from cages on the town walls. Others, like the Maid of Norway, were sent overseas as diplomatic pawns, in her case sailing to Scotland at the age of seven, to take up her highly disputatious role as queen. She died en route.

Down the centuries, no figure, male or female, stands out more vividly than Mary Queen of Scots. One of the reasons she has caught the popular imagination is that, during a highly eventful, tumultuous life, she left such a substantial and revealing store of letters. A charismatic figure, almost every move she made was recorded by those near her. Whether they loved or loathed her, they recognised they were in the presence of a remarkable individual.

Mary Stuart’s dramatic reign represented a high point for women’s influence in the public domain. But with accusations of aiding and abetting murder and committing treason, leading to her eventual execution, it was also its nadir. What Mary experienced, though, as an educated and privileged royal, bears no resemblance to the way commoners lived. Her end might have been grisly, but it was no more so than that of countless others, who did not survive childbirth, or died of malnutrition or disease, or were too old to scrape a living, and ended their days as paupers. To catch a glimpse of these women, in the 16th century and earlier, is like crouching at a keyhole. They can be spied, but fleetingly, incompletely, with too much left to guesswork.

One of the most regrettable chasms in the historical record is that except for occasional appearances in legal documents, the vast majority of women, for 1500 years and more, passed unnoticed. Hidden, invisible, or unimportant, they were airbrushed out of existence. The same can be said of men from the lower classes, and children of all ranks.

Thank goodness, then, for the Reformation, and the impulse it brought to introduce universal education. By the 17th century, women with the time and means were keeping journals, sending letters, and soon would be writing books and in some cases, such as the brilliant mathematician Mary Somerville, setting the intellectual world alight. At the same time, the sourcebooks of history – still kept strictly in men’s hands – grew more abundant, and as they become more expansive, so do women make more frequent appearances. From this point, more or less, Her Story finds its voice, as women begin to tell their own stories.

What a wealth of information they offer about how we lived. It’s like stepping into a novel by Mary Gaskell or Jane Austen, utterly captivating, but also true. In gathering the material for this book I have tried to capture the pivotal moments of history – witchhunts, the Restoration, Covenanters, Jacobites, the Clearances and the industrial revolution, suffragettes, the first and second world wars, the birth of the welfare state, and so on. Yet while these are the backbone of history, some of the most pungent stories come not from the front row of history, as with the widow who found the hacked and smouldering bodies of Red Coats outside her house at Culloden, but from seemingly incidental, mundane detail.

A description of changing habits by compulsive diarist Elizabeth Mure in the 1760s, for instance, shows the difficulty women had in meeting eligible men, most of whom seemed to prefer drinking and gambling with their friends to finding a wife. When women ventured out to a public event, in hope of finding romance, they usually found the men dead drunk. “In this kind of intercourss [sic] there is little chance for forming attachments. The women see the men in the worst light, and what impression they make on the men is forgot by them in the morning.” A century later, factory worker Ellen Johnston’s overwrought memoir offers one of the earliest allusions to sexual abuse. In her case it was so dreadful she contemplated suicide.

Also the victim of savage domestic abuse, but at the other end of the social spectrum, is the Countess of Strathmore, an heiress whose money-grabbing second husband was violently cruel. The result was a blow-by-blow account, at his command, of everything bad she had ever done. Consequently, we learn how 18th-century society ladies terminated unwanted pregnancies by their lovers: “I prevailed upon him to bring me a quack medicine he had heard of for miscarriage; it was of a copperas [coppery] substance, by the taste and look; he gave it me very reluctantly, as he said he did not know but it might be poison; however, I would have it.”

Fast forward down the years, though, and by 1923 things there is young Ann Flynn, not long out of school and working in a Glasgow office: “And I had there my first encounter with someone trying to play me up sexwise. My first encounter was with one of my nice boss’s friends. And I remember removing his hand from me and looking up at him and saying, ‘Do you see these teeth?’ (I had very good gnashers then) ‘See these teeth? If you so much as lay a finger on me I shall bite right through till the blood drips out of you.’ And the man drew back and looked at me with such surprise...”

From incidents like this, and far worse, the #MeToo movement has emerged. The need for taking such a stance, even in these supposedly enlightened times, tells its own story. Too many men still hold assumptions as old as the hills. In this respect, Ann Flynn’s story is only one of many in the book which are timeless, connecting the experiences of women from every era since records began, and melting the years between them.

For most of the past, of course, women’s domain has been primarily at home. For every wife who sprang her husband from gaol in disguise, like the Jacobite Countess of Nithsdale, there were thousands who did nothing more thrilling than keep their families fed, clothed and reasonably clean. Some excelled at this. To read Victorian domestic goddess Margaret MacKirdy Black’s guide on how to cook, run a house and do the laundry is to realise what hard and all-consuming labour it could be. An account of how a 19th-century farmer’s wife spent her day, from dawn till after dark, is humbling. For those with servants to help ease the load, they brought their own problems. In the case of Jane Carlyle, wife of the famous historian but more importantly one of the finest letter writers of her day, her housemaid was an alcoholic. This could make things fraught, especially since she was so fond of her.

In another Victorian household, the cook’s temper was as hot as her curries. Sacked from one post by the novelist Janet Storey, Betty went to work for a friend of hers. It proved a short-lived reprieve. “Not long after she had taken up her duties, Mr Sprot, hearing from his wife that what she considered too large fires were being burnt in the kitchen, and that the cook paid no attention to her remonstrances, went downstairs one day to have a look himself. The fire was large, and he began to venture on some observations, when he was promptly accosted by Betty seizing in her hand a large kitchen towel and flapping it violently on the table, exclaiming in a furious tone, ‘Oot o’ ma kitchen! Oot o’ ma kitchen! I’ll hae nae spyin’ maisters here!’ while her attitude and manner were so menacing that the much-alarmed gentleman lost no time in retiring from the lower regions”. Not surprisingly, Betty departed shortly thereafter.

It’s often said that history is written by the victors but it has also, until the last century, been exclusively written by men. In my book I have tried to redress some of that imbalance, to capture a fraction of a world we have lost, and fill some of history’s gaps. Constitutional, political and religious affairs play their part, but the main focus is not on edicts or treaties, battles or wars, but on people. It is a snapshot of those girls, women, daughters, wives, aunts and grandmothers who underpinned everything that happened, yet who, until recent times, rarely made the headlines because their efforts were considered unimportant.

In these pages, you watch how women married, gave birth and raised their families from the times of St Margaret to our own; how they earned a living, tended the aged or felt about getting old themselves; how they viewed their politicians and society, struggled to be educated, campaigned for their rights. To witness all this is to see the country not through the lens of official accounts, but in three dimensions. It adds a layer of depth and complexity, and gives a place to the everyday, which is not to say it was not extraordinary. From the medieval nursemaid who had a baby torn from her arms and murdered to the gunner’s wife in the Napoleonic wars who gave her husband wine to keep his spirits up during battle, from the Iolaire widow begging for support, to the adopted black baby girl who blossomed to become our Makar, the stories that have brought us to where we are today are a powerful and inspiring legacy. As they take us back, whether only a few decades, or several hundred years, this doesn’t feel like history. It feels like life.

Scotland: Her Story by Rosemary Goring is published by Birlinn, priced £20