What is considered a perfect repentance? When one is faced with the same opportunity to repeat the original transgression, but now he does not do it because he has repented... however, when one does not repeat the original transgression, [and refrains from sinning] because now he fears people will find out... his repentance is still accepted, but it is not considered a perfect repentance
Maimonides gives the example of a man who was involved in an illicit relationship and later on repents. The ultimate test of his repentance would take place if that man is eventually faced with a similar opportunity but now he refrains from repeating the transgression because of his new understanding and remorse.
However, if that man is not faced again with similar circumstances as those leading to his earlier sin (he definitely should not seek them!) or if he faces a similar scenario but now he refrains from sinning because he suspects somebody will find out about his affair, his Teshuba is still accepted. But it is not a perfectTeshuba. Why? because this man might now have changed not because of his conscience, but because of the new circumstances.
A modern example: Sometimes we read in the news about famous people caught doing immoral things. Almost invariably, they would come in front of the cameras and publicly repent and apologize for what they have done. That act is definitely an act of repentance. However, it is at least questionable in terms of its credibility and genuineness, since the whole process of repentance happened as a consequence of having been caught. It cannot be known if they would have really repented from their wrongdoing had they not been caught...
Following Maimonides, the perfect repentance in this case would take place when, while still involved in an illicit relationship or other immoral act, and with no external impediment to continue with it, one decides out of his own conscience (not because of the media!), to stop, repent and change.
That is a perfect and credible Teshuba.