I read the question if people really did count sheep. But I would like to know is where it came from.
Counting Sheep supossedly arose from Yan Tan Tethera, the way scottish shepherds counted their sheep.
Then it became this thing in pop culture thanks to comics and such and the rest, as they say, is history…