The relationship of the first and second laws of thermodynamics based on their energy nature is considered. It is noted that the processes described by the second law of thermodynamics often take place hidden within the system, which makes it difficult to detect them. Nevertheless, even with ideal mixing, an increase in the internal energy of the system occurs, numerically equal to an increase in free energy. The largest contribution to the change in the value of free energy is made by the entropy of mixing, which has energy significance. The entropy of mixing can do the job, which is confirmed in particular by osmotic processes.