Can magnets harm an iPad? My kids were playing with some cool magnetic rocks and left them sitting on top of our iPad. This provoked some non-trivial discussion in our family as to whether this was a bad thing.

I grew up in the era of magnetic floppy diskettes, where sitting a magnet on one could cause you to lose important data. But the iPad, as far as I can tell, doesn't have any magnetic storage. It clearly does have magnet sensors, as that's how the Smart Cover turns it off and on, and I'd hate for magnetic rocks to desensitize said sensors, but I'm also thinking that it seems unlikely that magnets will cause data loss.

What are the risks, if any, of leaving medium-strength magnets (not weak, but not any kind of industrial super-magnet), sitting on top of an iPad? Assume that the screen is covered, so I'm not worried about scratching the glass.
You should be fine. As you note, there are magnets (which are actually fairly strong for their size) in the iPad and Smart Cover. There are no magnetic components aside from the Smart Cover attachment points and the unlock sensor—there's a magnetometer for the compass, but it doesn't use a magnet.

Furthermore, the whole magnets damaging hard drives thing is a bit of a myth. You can wipe them with magnets, but it takes a very powerful one, pretty much nothing you'd have in your home.