take a simple eg of water water disassociates to form oh and h ions. right but this process is endothermic
why? because see in the water molecules there is hydrogen bonding the hydrogen of a molecule attracts the O atom in the molecule as it 4 unpaired e in its octed thus the interaction bw the molecules is very lerge ie the molecules are very strongly bonded so some energy is required for its disassociation
your doubt about how will i know which one is more stable i would say that this is not the stage to understand this requires multiple concepts from all fields of chem don't get worried u'll learn more about it in +1 and even in 10th best of luck