How can you calculate the tendency of one compound to become another?
Depending on the constraints you impose on the system, there are different criteria for spontaneity, however, the commonly running theme is that it is related to minimizing some state function. For example, as a simple example from classical mechanics, the time evolution of the system is such that the potential energy of the mechanical bodies is minimized.
When we do a chemical reaction, we usually do it at constant temperature and pressure. In this case, the evolution of the system is determined by a potential function known as Gibb's free energy. If there is a state in which the system which reduces Gibb's free energy, then the system will evolve to reach that state. When I say evolve I mean to have processes such as chemical reactions.
I had actually written a very detailed answer about this on physics stackexchange, check it out for more information (here)

Refer these notes by MIT for the criteria for spontaneity for different constraints :
MIT ocw notes
Discussion about constant P and T chemical reactions:
Here