Imagine this: a muggle born student comes to Hogwarts near the end of the ninteenth century. The lightbulb is just becoming a thing, and they can't help but think that surely a magical school would have them. Heck, Mr. Edison was even called "The Wizard of Menlo Park". That's seems to be a big hint!
But then they arrive. There is no hint of electrcity. They are surprised, but not too much. After all, it is an old castle. They might casually mention it to their friends, who realize that they have a good point. Eventually, the teachers find out. They look into it, and it seems cool, even though Edison is merely a really clever Muggle. They decide to try it out. One of them buys a couple of lightbulbs and some sort of hand-cranked electric generator (I'm sure they could find one somewhere). They bring it to Hogwarts, everyone all excited, even the snobbish purebloods, and try to get it to work. For second, the lightbulb glows prettily. Everyone oohs and ahs. Then, it promptly explodes. Just in case it was a fluke, they try it again. Still doesn't work. Convinced that electricty will never amount to a thing, they give up trying.
Zoom ahead to a few years. People pretty much accept there's no electricity at Hogwarts now, as even if it would work, they somehow would have to casually subscribe to an electric company to provide it with power without anyone noticing; after all, muggles only see a decrepit ruin saying "Danger! Do not enter, unsafe!" (GoF Chapter 11 pg 166). It would be hard to explain to a muggle contractor that you need to wire a decrepit ruin, and furthermore, that the ruin would run up a high electric bill monthly.
However, they do notice the presence of electric things. As seen in this: https://web.archive.org/web/20060316221619/http://www.jkrowling.com/textonly/en/faq_view.cfm?id=81
archived FAQ with Rowling, the camera and radio are both adapted to work around magic. Therefore, they must have realized at some point that magic messes with electricity. As electricity mainly is ruined by the overbearing presence of magic, it would only really matter in places like Hogwarts or the Ministry of Magic, which is why it would only be included in text such as "Hogwarts: A History", explaining why Ron wouldn't realize that bugging Rita Skeeter (GoF, Chapter 28, page 547 in my edition) is pointless.
Still, only children who are aware magic exist would know that electricty doesn't tend to work around it. Muggle-borns would probably bring all their electronics with them, blissfully unaware until their iPhones explode, much to the entertainment of their wizard/witch friends. This is how at least wizard children are kept aware of progressing technology in the world. As far as adults go, most don't care, but there is always the occasional Arthur Weasley who will go and collect plugs and batteries (GoF, Chapter 4, page 46 my edition) and whatnot.