This is a very complex and interesting evolutionary concept. The size of an animal is being pulled in many directions at once by many positive and negative selection pressures. These pressures literally hone in on the perfect size range for an adult. Since males and females have different pressures being applied, there is a chance that their sizes might differ. If that seems confusing, it's because it is.
For example: If you have an adult turtle, let's say, living in a salt marsh... There is a biologically ideal size for that turtle given its environment. This size will allow it to evade predators, eat the foods it's supposed to eat, thermoregulate effectively, etc. etc.
Let's say that size is 4 inches carapace length for argument's sake. At four inches, a turtle is perfectly adapted to its environment.
OK, that in mind... Imagine a 4 inch female and a 4 inch male. The female will have different pressures put on her because of the fact that she must carry eggs. A smaller shell means smaller and fewer eggs. While 4 inches might be the biologically ideal length for the turtle, 12 inches, let's say, might be the biologically ideal size for holding the maximum amount of properly sized eggs. This is KEY. If the eggs are small, she may be able to lay more of them, but the babies may hatch too small to avoid predation, or to effectively eat available foods. If she lays fewer large eggs, there may not be enough babies born to survive to breeding age. So a females size, is constantly being pulled by these factors. Her shell must be large enough to hold the maximum amount of appropriately sized eggs, but not so large that it causes her to outgrow her biological niche.
Hogs are, clearly, the same way. They are not alone. There are size differences in many snakes from burmese pythons to garters snakes. As you mentioned in your comments, there are also males which are larger. This could be because of many factors. Combat is a good guess, but also consider cannibalism. Kingsnake males are similar in size to their ladies, or larger in my experience. If they weren't, they would probably get eaten. However, it could also be that the female is being limited for reproductive reasons. (It works in reverse too) maybe the ideal reproductive size for some species is smaller than the ideal adaptive size. Ya know? I hope that wasn't too confusing.