Resonance stability: ester vs. thioester
Try to understand it in a layman's way, greater the extent of overlap between the atoms, the closer their nucleus will be. The stability of the molecule will thus increase as stability of a molecule is inversely proportional to the bond length of the atoms in the molecule. 

However this is applicable only upto some extent like your situation but if the nucleus of two atoms get too close a stronger force which is nuclear force starts acting on them which repels them, it is a very short length force.