It happens regularly in NZ, because of the fruit and plant matter laws.
The point is, you're reminded so many times, and given a form where you have to tick 'I don't have this, or this, or this', that not knowing is really not an excuse. Like any country, ignorance of the law is not a valid reason to break it. By the time you've got to that point, it's assumed you can't be ignorant and are not declaring it on purpose.
As a result, there's a good chance you'll be fined.
Sometimes if they can see it's an honest mistake - eg you've taken five apples out and forgot the banana under three shirts at the bottom of your bag, you might get a warning. Not cleaning your hiking boots will get you a talking to, but they'll often take them off you and clean them for you anyway.
Naturally if it's a bigger problem (drugs, weapons) then there's potential for arrest or jail time, but for smaller things, it's usually a fine. For example, even famous actresses can get fined for forgetting to declare fruit.
On the upside, they sometimes have fruit sniffing dogs pre-declaration, looking for stuff, and if they find an apple or orange at that point, they'll just ask you to throw it away. As far as I've seen, it's only when you've officially signed a form declaring you have nothing, that you are now breaking the law.