Why/when do Pokemon run away?
Your own captured Pokémon will not run away. The only way to lose it is transferring it by accident. Your journal is showing an instance of a wild Ponyta fleeing from battle, which can happen randomly if you fail to capture it too many times, probably more commonly with stronger Pokémon.
A good way to ensure a capture is using better Pokéballs and Razz Berries, but keep in mind that capture attempts can still fail and Pokémon can still flee even when using those items.