Minecraft Wiki Wrote:Many mobs have an advanced pathfinding system that allows them to traverse complex mazes to get to a desired object or destination.
There is a chance some one placed a dirt block or something to jump a fence around your land and the pathfinding of said pig basically made it see an escape from captivity. It is not something we can control very easily as it is encoded into the game itself. Best to pen the pig most securely or encase it in glass.
As for the leashed horse, it is a bug mojang intends to fix. again we can't control this. Best to put the horse in 2 block deep pit if you plan to leave it for more than 5 minutes at a time.
This is the bug report
MC-14826 – Leads in unloaded chunks break, become invisible or connect to an invisible target far away
https://bugs.mojang.com/browse/MC-14826Take note where is says Fixed versions: 1.10 Which is a version far in the future, given the current track record probably late 2016 - mid 2017.
There is other fixes in version 1.10 if interested.
http://minecraft.gamepedia.com/1.10