In addition to instinctual factors, it is only fair to note that our pet housetraining procedures are somewhat more draconian than our baby housetraining procedures. This alone might account for the discrepancy between pets and kids vis a vis the deposition of urine and feces on the carpet.
When Baby has grown old enough for Mum and Dad to start thinking about the toilet, it's not uncommon for Baby to take a few practice trips to the toilet to get him comfortable with the idea of sitting on a hole suspended over a huge bowl of water. Proportional to Baby's diminished height, this bowl is enormous! Gargantuan! Baby-sized! And upon flushing, it makes a terrible howling gurgling noise! And so Baby must slowly become accustomed to the idea of the toilet, with a training seat and plenty of encouragement.
In comparison, the first time Fido makes a mess in the den, he can expect (at the very least) a "BAD DOG" growled in the most threatening tone he's heard, coming from his strange new master. He can also expect to get his nose rubbed in the mess and perhaps also a few blows from a newspaper. If his owner is a progressive dog person then Fido may undergo somewhat gentler treatment--say, a trip outside to a grassy strip where he is invited to closely examine the mess in its proper location. While it's a bit more kind than thwacking him with a newspaper, he still ends up with his nose a mere fraction of an inch from his own feces. (At any rate, a properly wielded newspaper doesn't hurt all that much. It's the psychological trauma of being thwacked that the pet reacts to.)
So: Fido, being a den animal and having an ingrained notion of proper toilet etiquette, has a good head start on Baby. Nonetheless, we find it necessary to use severe discipline to get Fido accustomed to the idea that the entire house is off-limits as bathroom territory. Without the genetic advantage, and without being subjected to strict discipline, is it any wonder that Baby takes so long to get the hang of using the toilet?