The Baghdad Battery -- or rather batteries, since there are a number of them -- are containers of unknown function from the Sassanid Persian empire (224 - 651 AD). They are not particularly ancient (they'd be either late classical or early medieval if they were from Europe) and would seem to be completely irrelevant to discussions about the relative intelligence of ancient and modern humans; they come, after all, from a period much closer to our own than to the Egyptian pyramids, and vastly closer than to genuinely ancient humans. (The "batteries" are often ascribed to the Parthian period -- which isn't that much older -- but the ascription seems to be based on nothing at all.) So why bring them into this discussion?
In any case, I don't know what they were for, nor does anyone else. They could, in principle, have been filled with lemon juice or the like and served as pretty crappy batteries, since all they are is a clay pot holding a copper cylinder with an iron rod inside it, but that seems unlikely. Since they were sealed with asphalt, they would have been single-use, short-lived, weak batteries, and since the copper tube was completely sealed over, they weren't usable anyway. It's not impossible that someone figured out that if you put lemon juice in a copper bowl and stir it with an iron rod you get a weird tingling feeling, and built something to create that sensation, but there's also no reason to think that's what they were. I've seen the claim that they resemble holders for ceremonial scrolls found in Seleucia, but I haven't seen any evidence for that claim either.