“IT SEEMED a universal thing,” says international photography curator Anne Lyden, broadly, when I ask her about the inspiration behind the new exhibition at the Scottish National Portrait Gallery this month. She tells me about the toddler "lighting up" at a giant photo of a baby which was part of the Taylor Wessing Portrait Prize exhibition which the gallery showed last year. “Two mums came in with their babies and they were both drawn to this huge photograph. The baby was squealing and kicking its legs in excitement. It was lovely to see. It made me think, there’s a young audience out there. We should give them something.”

And so here it is – When We Were Young (or Very Young, as the wonderful book of children’s poems by AA Milne goes), a large photography show of images from the 1840s to the present day looking at the changing experience of all aspects of childhood. All the works are from the permanent collection, which, at nearly 40,000 images, is a formidable thing, not least when it comes to picking just a few hundred to form an exhibition. And most wonderfully, too, they will all be hung at a slightly lower level than normal, so that all visitors, including delighted toddlers, can see an image at their eye level.

Last year’s Landscape exhibition, the first in this series of three major exhibitions drawn from the permanent collection, was chronologically organised, but When We Were Young, the second of the series, is thematic. “Family is the big thing at the start,” says Lyden. “Education is another theme…We’ve got two lovely photos by David Williams from the series he made in 1984, a period early on in his career when he was Artist in Residence at St Margaret’s School for Girls in Edinburgh. He was charged with teaching the kids and documenting the school, so he really managed to get some beautiful scenes of that time when the children are growing up and school is a major part of their life.”

It’s easy to forget, says Lyden, that school has not always been a given, and that “it was only in the late 20th century that the UN decreed that children under the age of 14 could not be in employment.” And so here is Work, a section in which children are pictured engaged in all kinds of jobs, from working on the family farm or croft to busking on the streets of London in the 1870s, or a “really quite endearing” image of three small boys standing next to a row of giant cod, “for scale” (no pun intended), in order to promote the export of the fish to Portugal in 1908. A recent acquisition, this latter was one of the catalysts for the show.

But Play and the Imagination is the major part of this exhibition, as it is a major part of childhood – were you lucky enough to be born in a place and time that did not require you to be earning the family’s bread at the age of six. There are familiar works, from Oscar Marzaroli’s The Castlemilk Lads (1963) to Roger Mayne’s Children playing on a lorry (1958). There are new acquisitions too from Larry Herman, who visited Glasgow in the 1970s, documenting everything from heavy industry to primary schools and the still then relatively new Red Road flats, with “many interesting scenes of kids playing.” Look back further and there is an early Hill and Adamson image, The Finlay Children Fishing for Minnows alongside contemporary, and provocative, work from Wendy McMurdo, whose Let’s Go to a Place explores the “fractured state” of children playing Pokemon Go, caught somewhere between the real and virtual worlds.

Curating this was, one senses, something of a joy, as Lyden tells me there are sections grouped by “cheeky faces”. “It’s not chronological, but more about exploring through sub scenes,” says Lyden. “It allows you to see how childhood has changed, how it is represented and how we respond to it.” And some things never change, she says, “like kids reading comics.”

It’s “not all sunshine and lollipops”, either, Lyden adds. There is extreme poverty documented here, amongst the play and the detritus – sometimes far too much of it – of life. There are also images newly acquired taken by South African photographer Pieter Hugo from his series 1994, which documents children in Rwanda and South Africa who grew up in the post- genocide, post-apartheid periods, respectively, who have no direct experience of those events. “The innocence of childhood,” Lyden points out, “is very vulnerable.”

When We Were Young, Scottish National Portrait Gallery, 1 Queen Street, Edinburgh, 0131 624 6200, www.nationalgalleries.org, until 15 April 2018, daily, 10am-5pm, Thurs until 7pm